Article View: linux.kernel.netdev
Article #3078Re: [PATCH net v3] xsk: freeze deferred pool teardown without blocking unregister
From: Björn Töpel
Date: Wed, 14 Oct 2026 06:30
Date: Wed, 14 Oct 2026 06:30
33 lines
6842 bytes
6842 bytes
James Hilliard <james.hilliard1@gmail.com> writes:
> Deferred pool destruction calls ndo_bpf() under RTNL. system_wq is
> not frozen during system sleep, so that callback can run after a
> device has suspended and gated its clocks. Use system_freezable_wq
> so running destruction finishes before device suspend and new work
> waits until process thaw.
>
> Keep assigned pools visible to NETDEV_UNREGISTER independently of
> the socket list. A released socket has already left that list, but
> its final pool put can queue destruction after workqueues freeze.
> A resume-time unregister would then wait for a device reference
> whose release cannot run until the resume completes.
>
> Track assigned pools per netdev with netdev operations locking and detach
> remaining pools after the notifier socket walk, including copy-mode pools.
> This also covers leased queues without scanning pools from unrelated
> devices or network namespaces. Remove the entry on assignment failure and
> normal teardown. The deferred worker still owns the pool and later observes
> the cleared device pointer, avoiding a second driver detach or put.
>
> The lifetime problem was identified by code inspection of the deferred
> release and system-sleep paths.
>
> Fixes: 1c1efc2af158 ("xsk: Create and free buffer pool independently from umem")
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Thanks, James!
Reviewed-by: Björn Töpel <bjorn@kernel.org>
Technical Details
Message-ID:
<87ik3494km.fsf@all.your.base.are.belong.to.us>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-346040-linux-kernel-netdev=dewy.ruReferences:
<20261013-xsk-suspend-teardown-v3-1-2d6be7602947@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-346040-linux-kernel-netdev=dewy.ru From: bjorn@kernel.org (Björn Töpel) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v3] xsk: freeze deferred pool teardown without blocking unregister Date: Wed, 14 Oct 2026 08:30:49 +0200 Organization: Usenet Network Message-ID: <87ik3494km.fsf@all.your.base.are.belong.to.us> References: <20261013-xsk-suspend-teardown-v3-1-2d6be7602947@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: usenet.network; logging-data="2233202"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:fGCvosrOs1Kif+/TfhkBAIjFm5o= sha256:ji8zXrlVeQvZVsUer3HD5v0ZE0YnIjrq8mUHIo7jkDA= sha1:X+WxBhTv49zGyKU4R06rOC0qSqs= sha256:jZ6s3tgm5MLflt/w6y3Pql60ym2gwQ7KL/h4FpQhjNk= 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 58BA7110000; Wed, 14 Oct 2026 09:31:12 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -1.34 X-Spam-Status: No, score=-1.34 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.24, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, 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 bt9Yo0U8S64e; Wed, 14 Oct 2026 09:31:09 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-346040-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id B74EE10FFDE; Wed, 14 Oct 2026 09:30:59 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id 45FFB2DC54; Wed, 14 Oct 2026 06:30:56 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFB2B37CD2C; Wed, 14 Oct 2026 06:30:54 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ELbns02/" X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7C86346AC5; Wed, 14 Oct 2026 06:30:53 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791959454; cv=none; b=lfIRvWvtFP6P6cGRqCQde01TqSTE5TY7h5kC7+UsmfHXQ6jpSvvzMqj88VzJM6rEX+HrXP/Zq1G5P8jzL5HyxJ1uhyPZENpsKHHfDB5/RaCtjiEfdKOEKdjFgt6M0ZgJGsCg5MgVGKQQDyQgOsPbT5wY/88/K9pCxS5gaZa8vp8= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791959454; c=relaxed/simple; bh=O7S/PivgorR9gwvIx958BdtTZiVLwTnQwr1GR2IjtWc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=o7Bv9YNI7UVClE+CfwfefrRpI40cYjIfHj+6TIs0T+LvtyU64gf27585RZvGXun6LogIbX9CG1SDchbPNO786WCaCrYi/U/MLOTarGw+M/B2u2xXwWr1Tyll8oWO6hYArBewNhqd9/57vEps3Ogc02WaxTtIZCn/vs5+g1701jg= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ELbns02/; arc=none smtp.client-ip=100.103.45.18 X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8C641F000FF; Wed, 14 Oct 2026 06:30:52 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1791959453; bh=O7S/PivgorR9gwvIx958BdtTZiVLwTnQwr1GR2IjtWc=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=ELbns02/HWQnEJhvmKnomE/ctBLg6COCyF4VfcGn74tCWhiFG2RPCdZ254m/xNgwb MSE+ocde7fkGG6LqM0ABtBd/7eiihoTuUxuKl22F+mz/52s2FVdK5MpJu/FcDf3L5P SGAkclQ5GYq8rCrJqtYbhr71OOeysS1YcFK20FZp1tqfYfn9/3E8EoNaB1AvGw2wdm vt1ol72FyDr3zB5Ue7Ruw0cHVVHdDi8ciehXwbIyiAUxs785eMyMqnJluifZImSjft +gSdb7o8Spq/hxGyq4A2FpABOUUThvyAECC+xHl0i0Zt0ROYhomb/03ul5LUphpal/ qrDrG8gRf0ZtA== X-Cc: bpf@vger.kernel.org, Eric Dumazet <edumazet@kernel.org>, "David S. Miller" <davem@davemloft.net>, linux-kernel@vger.kernel.org, James Hilliard <james.hilliard1@gmail.com> X-In-Reply-To: <20261013-xsk-suspend-teardown-v3-1-2d6be7602947@gmail.com> X-Precedence: bulk X-Mailing-List: netdev@vger.kernel.org X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>