๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #5041

Re: [PATCH net-next 2/2] net/sched: Don't wait for RCU when unregistering the qdisc lockdep key

#5041
From: Eric Dumazet
Date: Mon, 19 Oct 2026 17:37
34 lines
10613 bytes
Le lun. 19 oct. 2026 ร  19:02, Vlad Poenaru <vlad.wing@gmail.com> a รฉcrit :
>
> Since commit af0cb3fa3f9e ("net/sched: fix false lockdep warning on
> qdisc root lock") every qdisc except ingress, clsact and noqueue
> registers a dynamic lockdep key, and destroying it calls
> lockdep_unregister_key(), which waits for an expedited RCU grace period.
> Replacing an mq root destroys one qdisc per TX queue under RTNL, so a
> single "tc qdisc replace dev eth0 root mq" waits for that many grace
> periods, each of which IPIs every CPU that is not idle.
>
> The wait is not needed here: __qdisc_destroy() and qdisc_create() free
> the qdisc with qdisc_free_rcu() after unregistering, which already
> keeps the key's memory valid for a grace period. Use
> lockdep_unregister_key_nosync(), and free with kfree_rcu() in the one
> qdisc_alloc() error path that used kfree().
>
> On an x86_64 KASAN + PROVE_LOCKING kernel (64 vCPU KVM guest, 64-queue
> netdevsim device, 214K lock chains) this removes 5.3 ms of grace-period
> wait from each of the 65 qdisc destroys in "tc qdisc replace dev eth0
> root handle 1: mq".
>
> Suggested-by: Eric Dumazet <edumazet@google.com>
> Link: https://lore.kernel.org/all/CANn89iLvu_ijSV+FnrZ6qei_Ty2c9V-RjwLMk24+oOS91bNjaQ@mail.gmail.com/
> Signed-off-by: Vlad Poenaru <vlad.wing@gmail.com>

Note the cover letter has 'From: Vlad Poenaru <thevlad@meta.com>', so
this SoB is a bit confusing.

Reviewed-by: Eric Dumazet <edumazet@kernel.org>

Thanks.
Technical Details
Message-ID: <CAL4WiioUPnMxAkoGWxpAT7AHa8-_Ep+Kvhugxib-ZznqCzTvRw@mail.gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-348760-linux-kernel-netdev=dewy.ru
References: <20261019170225.729789-1-vlad.wing@gmail.com> <20261019170225.729789-3-vlad.wing@gmail.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-348760-linux-kernel-netdev=dewy.ru
From: edumazet@kernel.org (Eric Dumazet)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 2/2] net/sched: Don't wait for RCU when
 unregistering the qdisc lockdep key
Date: Mon, 19 Oct 2026 19:37:26 +0200
Organization: Usenet Network
Message-ID: <CAL4WiioUPnMxAkoGWxpAT7AHa8-_Ep+Kvhugxib-ZznqCzTvRw@mail.gmail.com>
References: <20261019170225.729789-1-vlad.wing@gmail.com> <20261019170225.729789-3-vlad.wing@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="3671708"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:DFQH3+PaXer5WuVp9Jn9XTMJ0+0= sha256:7fPkmhojQbBtTLGFbR2pSfcpFTwhTVA1DuBYHXFRw6Y=
	sha1:wNQ0C3I7pp8pMVJg7BnyI92LOVw= sha256:dP6bZEuYW0jOUc3x1GkFlz4rsuL0+1iiyujeNmC6kdU=
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 5414B110A99; Mon, 19 Oct 2026 20:49:31 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.729
X-Spam-Status: No, score=-3.729 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.329, 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 FOwYbEyyw8UH;
	Mon, 19 Oct 2026 20:49:28 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-348760-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 D45F1110A36; Mon, 19 Oct 2026 20:49:19 +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 B1ADCC77C1; Mon, 19 Oct 2026 17:37:44 +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=1792431461;
	b=HOIuGabGoFufs4vUIRZtxEYEqgq4LaV8uSluff2v9jyqQgUqV4RjxVsCxcX9UKciBrqb
	 NXEqhSdqAsxUQ21CY3htVXg6E4ldpqPOcoNSFpfsR2yXl+/Sia7UdcrX5UaD0BmC0FMtV
	 PXijBV16mLlm+gQxvEs5w8N5hWTPDa7Y6h4FDmEDsezmLXRzS/UqW9hbWaTlDLAsL8Gvj
	 FfkoSx3dGeQ3j2Hot80xUqpWGDNuWebz8zDRZS2wSoX8r5I4gywhfNex2fH8TClbpPldf
	 NkQSXzGbTAxZoOjeXYdpMjc0tVzl4ss6hopRDpL6IzpYI2Cl9INSl2bX71dcaBlTGUg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792431461;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:
	 X-Gm-Message-State:X-Received:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:References:In-Reply-To:From:Date:
	 X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:Subject:To:Cc:
	 Content-Type:Content-Transfer-Encoding;
	bh=3jsS+FNvhPFXRiNcpF56A9Osarqkn7xZmkyJiCqJ+Y8=;
	b=LIlBc5d5EB43xUaXL9/z09Z4C7nxs8kJkSvbtyYFXBvzSjVewmAcELWdGDwHPyM7732a
	 4UdaFu6uR13NIk6a1zvjzTwwaELLEAjPV1W666eNgvFGUGvyYtlFaWBcck8KhT67PsSIA
	 oaK8ww8SnuXAya8hA5+MeeIQExk232lkk9i5JeXuXQAxneOJ1xNX99PSJDhHLTeMcVzSk
	 cyfrV8otvsbFNh2FtdTDLpTwm8d21TSY+WJ01WVx07PZT5YCeHCvJGdv2VR37kCrMKqlA
	 ZxSsGPNXgd/LpCM2Bv68juBJ2L896a0OtpeFltBjxKOMfYQgjrJVyJFwu72eqoc/kOQ==
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=GVtcrFVI;
	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 0F867606A329;
	Mon, 19 Oct 2026 17:37:41 +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=GVtcrFVI
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=1792431460;
	b=EyWKUY2lLOSuRzmMp+NRKX3vCe9l6aCcpE6KlFtl5u5henMxYdi+XnKSlM6ajDAbcOIM
	 DgFCGcQSHh+cvlWF3cKaA30I9mw8PgGbuWhgxaDvCUc4Lg1VeOOUMhAQzLfT66jNxHgZP
	 t175VCL1VT2ESn3kXuEfkBpqV1e+/fTJ51rTNopNtGCw4r6HJdVbAbYewrE8eeRWRDZBq
	 ORcE53IY6QLuFQ1WXPKGh6iFlx6Ew771HtEW7bYk6d16upKs/9KCreZwwNPey6meqW3eO
	 3iF6+Ufh/PXqxMDmLEyoFudVyWWXi0NAu5QJOeXOuTnEUeF3f8GrwcbjaXNM5KvZSuQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792431460;
	h=Received:DKIM-Signature:Received:X-Gm-Message-State:X-Received:
	 MIME-Version:References:In-Reply-To:From:Date:
	 X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:Subject:To:Cc:
	 Content-Type:Content-Transfer-Encoding;
	bh=3jsS+FNvhPFXRiNcpF56A9Osarqkn7xZmkyJiCqJ+Y8=;
	b=XpfLSj/32568Oy3fqUtIqdMWnLNpMHeFlVed23FcmH4dIxDIcIIgwAyLV3IMSb6Sqbwa
	 7Oj47t+laKlCwHM1203Y/cKpZlORifcMSycHfb12MAy2AYr845qsoKLTTrH+r0tJ1gOZ9
	 a5PL8vst43CH6jSk6bwEZ3MgSglBpwfGQyz0w738QBnZIUrsQG1n5ujyLJqu8DJYNXk5f
	 lrkGPSC8Lrr9kFA7nErVeyIM+VkVFfCCAaf+KVygXKTKit7n6dfTgeKiffVkzMAd+HCSL
	 mCV/4M/Rilt4rRiL31yV9eBC4TFNfp1fSKc00/NH0aI5+gaezbWj4y77CBA2P60wFiQ==
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=GVtcrFVI;
	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 E6E6C606A31E
	for <netdev@vger.kernel.org>; Mon, 19 Oct 2026 17:37:39 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 793C61F000CB
	for <netdev@vger.kernel.org>; Mon, 19 Oct 2026 17:37:39 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1792431459;
	bh=3jsS+FNvhPFXRiNcpF56A9Osarqkn7xZmkyJiCqJ+Y8=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc;
	b=GVtcrFVImLGYgjXGyo4tFVbzGCn7jhOhpHmYHiAqItt+oOq4mQcQCGCJtYqrzui7r
	 x6ejFbKXf4Jz/emcs8KEpYgujPqft8G3Vomg/n5qrQjduZOdNqLv5+6yEGRvgY8BaT
	 ETCb2b7UH+eYgNoFg8OgH3Z3F/Ym4LFaEQQvttnu82h2ZGxcs0kGF8/mRJiw7/UhDO
	 RBCLdS9PB1ez4LRBN9ayEJryr/EQkuexa8bSlS07Z4585Fd8dQigCexiQokya+RT7W
	 1G4QM6EYEgaqaAIf7ppI41wH2nxIngagxVISYa9rpOLY7ridgqQ75eXp0NXM8bxQs5
	 eUoOBvY+VyUgQ==
X-Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-704597ef1d8so645295eaf.3
        for <netdev@vger.kernel.org>; Mon, 19 Oct 2026 10:37:39 -0700 (PDT)
X-Gm-Message-State: AFq9FYJ4fDerfwPhTLtyU4NoaiPJd3Kk5EakvkhXK1MVFDTwBngqJgNW
	anPI7Y8hlgPgngKOubBWqsKbBjDdlZm4JnO0y7InkE4OseeTVqnbX4WcOkHa1KZTOEV+PF5oXa6
	BBjh1sjBHS1wGGpuSFowBg9T1ztQlOLU=
X-Received: by 2002:a05:6820:8cc:b0:6dc:99b3:2efc with SMTP id
 006d021491bc7-70356392c96mr5105426eaf.43.1792431458807; Mon, 19 Oct 2026
 10:37:38 -0700 (PDT)
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
X-In-Reply-To: <20261019170225.729789-3-vlad.wing@gmail.com>
X-Gmail-Original-Message-ID: <CAL4WiioUPnMxAkoGWxpAT7AHa8-_Ep+Kvhugxib-ZznqCzTvRw@mail.gmail.com>
X-Gm-Features: AclHuK_6szSoVVhZVQEh44AAfITVZxXWoYCC47ElAK_YE8jC0b-RxlR2q8JjGZk
X-Cc: netdev@vger.kernel.org, Jamal Hadi Salim <jhs@mojatatu.com>, Jiri Pirko <jiri@resnulli.us>, 
	"David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, 
	Simon Horman <horms@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, 
	Will Deacon <will@kernel.org>, Boqun Feng <boqun@kernel.org>, Waiman Long <longman@redhat.com>, 
	Bart Van Assche <bvanassche@acm.org>, Davide Caratti <dcaratti@redhat.com>, 
	Breno Leitao <leitao@debian.org>, Nilay Shroff <nilay@linux.ibm.com>, linux-kernel@vger.kernel.org, 
	Eric Dumazet <edumazet@google.com>