All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Marco Crivellari <marco.crivellari@suse.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: Tejun Heo <tj@kernel.org>, Lai Jiangshan <jiangshanlai@gmail.com>,
	Frederic Weisbecker <frederic@kernel.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	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: Wed, 22 Jul 2026 10:29:50 +0200	[thread overview]
Message-ID: <f972b514-87ef-45bc-8258-db199a4cc0b8@suse.com> (raw)
In-Reply-To: <20260720100902.155605-6-marco.crivellari@suse.com>

On 20.07.26 12:08, Marco Crivellari wrote:
Hi,

> 
> Since the workqueue work doesn't rely on per-cpu variables, there is no
> obvious reason that justify the use of a per-cpu workqueue. So change
> system_long_wq with system_dfl_long_wq so that the work may benefit from
> scheduler task placement.

these changes are problematic, although they look like a good cleanup
in first place. But the test you are using to determine whether USB
devices need their own work queue is incomplete because you are not
considering the reason they allocate their own work queues.

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.

That is also true for any operation on a work queue they need to wait
for to make progress. That means you cannot limit your check to per-cpu
variables. You also need to check for such dependencies. In particular
any usage of flush_work() on such queues can deadlock, if you use
common queues.

Please refrain from making such changes unless you have fully analyzed
the dependencies.

	Regards
		Oliver


  reply	other threads:[~2026-07-22  8:29 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 [this message]
2026-08-25 15:18     ` Sebastian Andrzej Siewior
2026-08-27 16:01       ` Alan Stern
2026-08-28  9:43         ` Sebastian Andrzej Siewior
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=f972b514-87ef-45bc-8258-db199a4cc0b8@suse.com \
    --to=oneukum@suse.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bigeasy@linutronix.de \
    --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=pabeni@redhat.com \
    --cc=petkan@nucleusys.com \
    --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.