From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oneukum@suse.com>,
Marco Crivellari <marco.crivellari@suse.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
Tejun Heo <tj@kernel.org>, Lai Jiangshan <jiangshanlai@gmail.com>,
Frederic Weisbecker <frederic@kernel.org>,
Michal Hocko <mhocko@suse.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Petko Manolov <petkan@nucleusys.com>,
linux-usb@vger.kernel.org
Subject: Re: [PATCH v3 net-next 5/6] net: usb: pegasus: Move long delayed work on system_dfl_long_wq
Date: Fri, 28 Aug 2026 11:43:18 +0200 [thread overview]
Message-ID: <20260828094318.bOajNBno@linutronix.de> (raw)
In-Reply-To: <31b46916-dd89-4ae9-89b9-9d39e29e8e69@rowland.harvard.edu>
On 2026-08-27 12:01:02 [-0400], Alan Stern wrote:
> > > These drivers have their own work queues because they are part of the block layer.
> > > USB devices can share a device with a block device (storage & UAS) and
> > > USB devices have common, per device operations, in particular reset
> > > and runtime power management and disconnect handling. Because these operations
> > > can be necessary to complete block IO neither they nor anything
> > > they depend on can use IO to allocate memory. That is they need to
> > > perform any memory allocation with GFP_NOIO or GFP_ATOMIC.
> >
> > This is a networking driver. It has nothing to do with storage and UAS.
> > It uses USB, yes.
>
> Ah, but a composite USB device can have both a networking interface and
> a mass-storage interface.
okay.
> Suppose you have such a device, and suppose the disk attached to its
> mass-storage interface contains a swap partition. Now suppose the
> device is being reset, and as part of the preparation for that reset the
> networking driver needs to flush its workqueue. This means waiting
> until the work routines that are already running have completed.
The individual functions are usually independent. But if the USB core
would reset the whole device it would reset each function.
> Since it's a general-purpose workqueue, you don't know what those work
> routines are going to do. One of them might try to allocate memory
> using GFP_KERNEL. Suppose that in order to satisfy the memory request,
> the kernel decides it needs to write some pages to the swap partition on
> the USB mass-storage interface. But the mass-storage driver is stuck;
> it can't do anything until the device reset finishes. Deadlock.
So you are saying, the USB-storage device is in reset and we wait until
the networking part finishes its workqueue flush. That flush is stuck
behind behind a memory allocation which waits on the storage device. So
any URB passed to usb_submit_urb() just waits for the reset to complete?
> That's why USB drivers have to use their own workqueues.
While this does make sense I don't see how this is related to this
patch. The pegasus driver uses `system_long_wq'. This is a system wide
workqueue_struct and is not limited to USB or this driver.
This workqueue is per-CPU meaning if you enqueue the work item on CPU3
it will be executed on CPU3. However pegasus uses a delayed work item
and the timer can fire on any CPU so even if it is enqueued on CPU3 it
could be executed on CPU1.
Therefore the suggested change system_long_wq -> system_dfl_long_wq
should not make a difference here: it is a different workqueue and it is
unbound (instead of per-CPU) but given the usage it is unchanged but
more obvious. Also its usage recommendations (use this for long running
items) is the same.
The plan is remove system_long_wq from the tree.
> Alan Stern
Sebastian
next prev parent reply other threads:[~2026-08-28 9:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 10:08 [PATCH v3 net-next 0/6] net: Move system_long_wq to system_dfl_long_wq Marco Crivellari
2026-07-20 10:08 ` [PATCH v3 net-next 1/6] ibmvnic: Move long delayed work on system_dfl_long_wq Marco Crivellari
2026-07-20 10:08 ` [PATCH v3 net-next 2/6] net: ti: icssg-stats: " Marco Crivellari
2026-07-20 10:08 ` [PATCH v3 net-next 3/6] net: ti: icssg-prueth: " Marco Crivellari
2026-07-20 10:08 ` [PATCH v3 net-next 4/6] net: thunderbolt: " Marco Crivellari
2026-07-20 10:08 ` [PATCH v3 net-next 5/6] net: usb: pegasus: " Marco Crivellari
2026-07-22 8:29 ` Oliver Neukum
2026-08-25 15:18 ` Sebastian Andrzej Siewior
2026-08-27 16:01 ` Alan Stern
2026-08-28 9:43 ` Sebastian Andrzej Siewior [this message]
2026-08-28 14:10 ` Alan Stern
2026-07-20 10:08 ` [PATCH v3 net-next 6/6] net: usb: r8152: " Marco Crivellari
2026-07-20 22:35 ` [PATCH v3 net-next 0/6] net: Move system_long_wq to system_dfl_long_wq Jacob Keller
2026-07-21 8:20 ` Marco Crivellari
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260828094318.bOajNBno@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=frederic@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=marco.crivellari@suse.com \
--cc=mhocko@suse.com \
--cc=netdev@vger.kernel.org \
--cc=oneukum@suse.com \
--cc=pabeni@redhat.com \
--cc=petkan@nucleusys.com \
--cc=stern@rowland.harvard.edu \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.