Article View: linux.kernel.netdev
Article #8070Re: [PATCH wireless v2] wifi: wext: Limit notifier event flushes to the device's netns
From: Jakub Kicinski
Date: Tue, 27 Oct 2026 23:27
Date: Tue, 27 Oct 2026 23:27
34 lines
9474 bytes
9474 bytes
On Fri, 23 Oct 2026 11:10:44 +0300 Cosmin Ratiu wrote: > With mlx5 netdev instance locking enabled, registering an IPoIB netdev > calls the WEXT notifier while holding the instance mutex. Its call to > wireless_nlevent_flush() takes net_rwsem to walk every namespace, > completing the following lockdep dependency cycle: > > netdev instance mutex -> net_rwsem (read) -> GID table mutex > -> event_handler_rwsem (read) -> netdev instance mutex > > RoCE GID enumeration takes the GID table mutex under net_rwsem. GID > updates dispatch events under the table mutex, taking event_handler_rwsem. > The IPoIB event handler takes the netdev instance mutex in > ipoib_queue_work() to traverse child interfaces. > > The all-namespace walk originated in the single global worker servicing > per-namespace WEXT queues. The ordering fixes later reused that routine > in netdevice notifiers to prevent delayed WEXT RTM_NEWLINK messages from > following RTM_DELLINK or reporting stale interface flags. A notifier only > needs to drain the affected device's namespace; there is no reason for it > to walk and flush all namespaces. > > Pass dev_net(dev) from both notifier callers and make the flush helper > operate on that namespace. Keep the all-namespace walk and net_rwsem in > the existing worker. This removes the instance-mutex -> net_rwsem > dependency while retaining synchronous flushing from the notifiers. > > It may seem strange that the fix for a lock cycle across multiple > subsystems lies in a completely unrelated part of the code, but this > seemed the most justified lock cycle edge to break. If Johannes thinks this scoping is good for other reasons - SGTM. But my knee jerk fix would be to skip all the wifi processing for ops-locked devices since no wifi device is ops locked.
Technical Details
Message-ID:
<20261027162710.34e0e17c@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352661-linux-kernel-netdev=dewy.ruReferences:
<20261023081044.728500-1-cratiu@nvidia.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352661-linux-kernel-netdev=dewy.ru From: kuba@kernel.org (Jakub Kicinski) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH wireless v2] wifi: wext: Limit notifier event flushes to the device's netns Date: Tue, 27 Oct 2026 16:27:10 -0700 Organization: Usenet Network Message-ID: <20261027162710.34e0e17c@kernel.org> References: <20261023081044.728500-1-cratiu@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="1657989"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Y3kLtKv0hzrTJDfvdA4xzxDRj9o= sha256:x2WoW98YFHXM/1TIBsS8SYeacSl2oAxUzI3c7WhHzbc= sha1:l5tKNAa0ZX1Cf84ii2BbTF6NWEk= sha256:Uu+NQtkD4f4OxwzFxwZhLY3SZ2RGkYfFOJ0X+eqE0RQ= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 154FE125C2A; Wed, 28 Oct 2026 02:27:53 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kvk-r1xnc2bB; Wed, 28 Oct 2026 02:27:46 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-352661-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 646B8125C1D; Wed, 28 Oct 2026 02:27:36 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 3E19327A72; Tue, 27 Oct 2026 23:27:34 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793143653; b=ia7z7CxhPW8FiKKJeFLS3SWOdIsA70Ptu9l0FYiiIIf7FT7yVFNDmOaBLJn94ysMUX8o zp3Xy6pM1PyI/bYgJcKJZVVBYAYkSGA206EHrXwo//GSy8wdg4rPvyBDAgPBKbG1cpSht 8oRn2xFoH835Av8LksLQ1dR+u4D6QZn2J9X+QLXr/MvliSGhKvp/CnogYwPMhBK/baIGs NPQBEvfW99+tmIlBSC446WoViWharZjTBHnK01Zp/25ogyCUFAbBs1AxMs69sPqEGjxx8 SPovTv1dG22Pwwaf6DGfLhMscDdTAOQ8XdjDyrerHSP6Zg/lUnkIgs4gMWnBjDoEoWA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793143653; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:In-Reply-To:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=6PiYxlEEX0HQs1enBKQ/4zeLAPHx1PfbUOEoP+WBVLo=; b=ssQMqIJcq9kMhAgr/ICfBSrqx0k8zDCw509K2cAt3+W3GFLfXtu4tZGmhU5f/4gXPAbz LY+h4KRR0toI94eymVlBucqzE1dBKZr2Z1cY5FU/p1FfJOlrJxiEcxUjcG0KVcCGdya5b 9S9CbKgaQfA+WxPQeYiNak1CxvpJfV0mu/C1YylynWM9vWXUwj/hxd5tgSOyHvTyfpuWo b/rvw2UrO99DxN5lm6cXPRJvEGWaZbDew3VG2mcMohzmKMCzISp7vMAp6AYlVAGAt3Zpp DL8nbjh5+Az4qRIqChB8YEN7tqrGW5c4aa2nRcyZNI+w5AyQx87oJTN2aHnfihu9KQA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QWMkrCgA; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B822606A320; Tue, 27 Oct 2026 23:27:33 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QWMkrCgA X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793143632; b=SOQw208Hft5KbM4G/YvlKSHzjy6wsCucMEsnOeXvAlXZdLkWOl3FaoUN+5oQl3oePBsD 3bOsCPFm6KEtk+i3a6njQpVwwVozP085B/3Lb10vvCUqmF+crVoTNfC8HEFA5HG14K3NS xDg4piy76guTHc4LfA22sCBIV2byTCL0CncUr2b5soo+iRtptswc0mh6gmi10ENPKoikR 0bTVhV5We6OqaVPTC2bugMWA75B3gFMutEA2g6vVYKwtMjENoB9wEjX9nHRXLYsltooy1 KOeffsK1tM4oOMjbawozNpuBNediL/XLQU0ZKsHa3NIWB1ulk52C819w/m+brX144tw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793143632; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=6PiYxlEEX0HQs1enBKQ/4zeLAPHx1PfbUOEoP+WBVLo=; b=cd1zlw8gt+kS9x7qPo3yXkh/Q47HeTaVyWgrFiySTyho0hamKBrEg5FeItkYoxuDqKh0 35y3preCguL6Inu7Ad2/6KAdE4Kl8nYHKg1gQQaHe+cGBeTR3ZHmFGM6ILv4HciyfinKB c7I5KVdfD5G7eL0a2D9+/8/MIqY2n1kffkMcQN36JdF4N2g/TyjsU3OVUxeQWnpdbePuG qtOWCsB7W8VZtWrUtE0pD7D+l/Oy7G2wRyX1fQ1dsxrV6f7AMiYobye1DKiIQ8zsBzK3d 9W2FeXIKPWFi96Us9IYz6VtWiMW336LqNXalhw9+5RWhBwV1KeJ00rJq2hEv3R4VFKw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QWMkrCgA; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7319D606A31A; Tue, 27 Oct 2026 23:27:12 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id B60D31F01825; Tue, 27 Oct 2026 23:27:11 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793143632; bh=6PiYxlEEX0HQs1enBKQ/4zeLAPHx1PfbUOEoP+WBVLo=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=QWMkrCgAZV0PjW43souxOJIGFHjjAKD6FO1vIC2Uhw2W6YQJaCgcdJ/cUqogWd/8g NylE37jKgsHEFuq2D7pxCrPKzt5NsqVTaxrI9UARVAt8lUBEQqk0ir2kOad/Xpv7Ft TsbGd8MvFlaMK349wO2PB+0LPa0nDhNL3XDQR3pVXZ0ku9Bm6b7U//GsNpeqoaVnWE S4hpJcMpULzC1NxSJTmv3FCrN1j8C+CwLWKOGOU1l4lg76wXxmMJB0tdYaB3hHfgaN tNJ+Mulsbv6gcNCv7nNP5GbgSRpRQ3FbjHFE5oM/4wgjGOJDFw2Ga0q3YgMWMuMOv+ vEiklsRVlCYmA== X-Cc: <linux-wireless@vger.kernel.org>, Johannes Berg <johannes@sipsolutions.net>, Tariq Toukan <tariqt@nvidia.com>, Carolina Jubran <cjubran@nvidia.com>, Dragos Tatulea <dtatulea@nvidia.com>, <netdev@vger.kernel.org> X-In-Reply-To: <20261023081044.728500-1-cratiu@nvidia.com> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list