From: Simon Horman <horms@kernel.org>
To: marco.crivellari@suse.com
Cc: Simon Horman <horms@kernel.org>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
tj@kernel.org, jiangshanlai@gmail.com, frederic@kernel.org,
bigeasy@linutronix.de, mhocko@suse.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, enelsonmoore@gmail.com,
linux-usb@vger.kernel.org
Subject: Re: [PATCH v2 1/5] ibmvnic: Move long delayed work on system_dfl_long_wq
Date: Sat, 11 Jul 2026 17:44:36 +0100 [thread overview]
Message-ID: <20260711164434.1691221-3-horms@kernel.org> (raw)
In-Reply-To: <20260706134033.244295-2-marco.crivellari@suse.com>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
Full review at: https://sashiko.dev
Simon says: While I think that the pre-existing issue flagged below is
orthogonal to this patch, I wonder if you could respond
to the question regarding scope raised in the first
issue flagged below.
---
ibmvnic: Move long delayed work on system_dfl_long_wq
This commit changes the code to enqueue delayed reset work items using
system_dfl_long_wq instead of the per-cpu system_long_wq. The intent is to
allow these unbound, long-running works to benefit from scheduler task
placement.
[ ... ]
> 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.
[Severity: Medium]
Will this leave the primary reset path bound to the per-cpu system_long_wq?
While this patch partially migrates delayed reset works to system_dfl_long_wq,
the initial reset work enqueued in ibmvnic_reset() is still bound to the
per-CPU system_long_wq:
drivers/net/ethernet/ibm/ibmvnic.c:ibmvnic_reset() {
...
rwi->reset_reason = reason;
list_add_tail(&rwi->list, &adapter->rwi_list);
netdev_dbg(adapter->netdev, "Scheduling reset (reason %s)\n",
reset_reason_to_string(reason));
queue_work(system_long_wq, &adapter->ibmvnic_reset);
...
}
Should queue_work(system_long_wq, ...) also be migrated to ensure the
reset workload fully benefits from scheduler placement as intended?
> diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
> index 5a510eed335ea..a1c01c9820d20 100644
> --- a/drivers/net/ethernet/ibm/ibmvnic.c
> +++ b/drivers/net/ethernet/ibm/ibmvnic.c
[ ... ]
> @@ -3267,7 +3267,7 @@ static void __ibmvnic_reset(struct work_struct *work)
> spin_lock(&adapter->rwi_lock);
[Severity: High]
This is a pre-existing issue, but can this plain spin_lock() cause a
deadlock against the tasklet context?
The workqueue handler __ibmvnic_reset() acquires adapter->rwi_lock using a
plain spin_lock() without disabling softirqs.
If a hardware interrupt fires on the same CPU while this lock is held, local
softirqs are processed on return, invoking ibmvnic_tasklet().
If the tasklet handles CRQ events via ibmvnic_handle_crq() and triggers a
reset (e.g., IBMVNIC_DEVICE_FAILOVER):
ibmvnic_reset()
spin_lock_irqsave(&adapter->rwi_lock, flags);
Will the tasklet spin forever trying to acquire rwi_lock since the preempted
__ibmvnic_reset() already holds it?
> if (!list_empty(&adapter->rwi_list)) {
> if (test_and_set_bit_lock(0, &adapter->resetting)) {
> - queue_delayed_work(system_long_wq,
> + queue_delayed_work(system_dfl_long_wq,
> &adapter->ibmvnic_delayed_reset,
> IBMVNIC_RESET_DELAY);
> } else {
next prev parent reply other threads:[~2026-07-11 16:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 13:40 [PATCH net-next v2 0/5] net: Move system_long_wq to system_dfl_long_wq Marco Crivellari
2026-07-06 13:40 ` [PATCH v2 1/5] ibmvnic: Move long delayed work on system_dfl_long_wq Marco Crivellari
2026-07-11 16:44 ` Simon Horman [this message]
2026-07-06 13:40 ` [PATCH net-next v2 2/5] net: ti: icssg-stats: " Marco Crivellari
2026-07-11 16:46 ` Simon Horman
2026-07-06 13:40 ` [PATCH net-next v2 3/5] net: thunderbolt: " Marco Crivellari
2026-07-06 13:40 ` [PATCH net-next v2 4/5] net: usb: pegasus: " Marco Crivellari
2026-07-06 13:40 ` [PATCH net-next v2 5/5] net: usb: r8152: " 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=20260711164434.1691221-3-horms@kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=bigeasy@linutronix.de \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=enelsonmoore@gmail.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=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.