Linux virtualization list
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jia Jia" <physicalmtea@gmail.com>
Cc: virtualization@lists.linux.dev,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Eugenio Perez" <eperezma@redhat.com>
Subject: Re: [PATCH] vduse: avoid infinite loop when no affinity CPU is online
Date: Sat, 19 Sep 2026 08:46:35 +0000	[thread overview]
Message-ID: <20260919084635.94DDA1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260919083933.104437-1-physicalmtea@gmail.com>

> If all CPUs in vq->irq_affinity are offline, cpumask_next() walks to the
> end of the mask, and the loop then resets the cursor to IRQ_UNBOUND and
> restarts the scan. When VDUSE_VQ_INJECT_IRQ is issued, the intersection of
> vq->irq_affinity and cpu_online_mask is empty, so the caller busy-loops in
> kernel context on its current CPU (e.g. CPU2).
> 
> Replace the while loop in vduse_vq_update_effective_cpu() with
> cpumask_next_and_wrap() to find the intersection of vq->irq_affinity and
> cpu_online_mask in a single wrapped scan. If the intersection is empty, set
> curr_cpu to IRQ_UNBOUND and let the existing unbound workqueue handle
> injection, avoiding repeated rescans when all CPUs in the affinity are
> offline. Use cpus_read_lock()/cpus_read_unlock() to keep the selected CPU
> online.
> 
> Fixes: 28f6288eb63d ("vduse: Support set_vq_affinity callback")
> Signed-off-by: Jia Jia <physicalmtea@gmail.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260919083933.104437-1-physicalmtea@gmail.com?part=1


      reply	other threads:[~2026-09-19  8:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-19  8:39 [PATCH] vduse: avoid infinite loop when no affinity CPU is online Jia Jia
2026-09-19  8:46 ` sashiko-bot [this message]

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=20260919084635.94DDA1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=eperezma@redhat.com \
    --cc=mst@redhat.com \
    --cc=physicalmtea@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=virtualization@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox