All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Waiman Long" <longman@redhat.com>
Cc: linux-hyperv@vger.kernel.org
Subject: Re: [PATCH v3] Drivers: hv: Avoid infinite retry loop in init_vp_index()
Date: Thu, 27 Aug 2026 19:56:29 +0000	[thread overview]
Message-ID: <20260827195629.85E5A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260827193750.662623-1-longman@redhat.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but the patch attempts to fix an infinite retry loop while relying on a flawed assumption, leaving a kernel hang scenario intact under CPU hotplug.
--

commit 357edd9f97074f4d93f3160be466a7aa7d20c7bb
Author: Waiman Long <longman@redhat.com>

Drivers: hv: Avoid infinite retry loop in init_vp_index()

This commit attempts to fix an infinite retry loop in init_vp_index() by
skipping NUMA nodes that do not contain any housekeeping CPUs. It aims to
ensure that a NUMA node with housekeeping CPUs is eventually found.

Link: https://sashiko.dev/#/message/20260422030903.E1BFCC2BCB0%40smtp.kernel.org [1]

> diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c
> index a044fd3b3c4e7..2e611d2de6d10 100644
> --- a/drivers/hv/channel_mgmt.c
> +++ b/drivers/hv/channel_mgmt.c
[ ... ]
> @@ -780,14 +781,16 @@ static void init_vp_index(struct vmbus_channel *channel)
>  				next_numa_node_id = 0;
>  				continue;
>  			}
> -			if (cpumask_empty(cpumask_of_node(numa_node)))
> +			node_mask = cpumask_of_node(numa_node);
> +			if (cpumask_empty(node_mask) ||
> +			    !cpumask_intersects(node_mask, hk_mask))
>  				continue;
>  			break;
>  		}

[Severity: High]
This is a pre-existing issue, but the patch attempts to fix an infinite retry
loop while relying on an assumption that leaves a kernel hang scenario intact
under CPU hotplug.

Could this while (true) loop in init_vp_index() iterate endlessly without
sleeping if an administrator dynamically hot-offlines all managed IRQ
housekeeping CPUs?

Since housekeeping_cpumask(HK_TYPE_MANAGED_IRQ) tracks all possible
housekeeping CPUs, the early abort check at the start of the function will see
hk_mask as non-empty even if those CPUs are currently offline.

However, cpumask_of_node() only returns online CPUs. If the remaining managed
IRQ housekeeping CPUs are offlined, cpumask_intersects(node_mask, hk_mask)
will evaluate to false for every NUMA node, causing this loop to spin
indefinitely while holding channel_mutex and cpus_read_lock().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260827193750.662623-1-longman@redhat.com?part=1

  reply	other threads:[~2026-08-27 19:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-27 19:37 [PATCH v3] Drivers: hv: Avoid infinite retry loop in init_vp_index() Waiman Long
2026-08-27 19:56 ` sashiko-bot [this message]
2026-08-27 21:10 ` Michael Kelley
2026-08-29  1:21   ` Waiman Long
2026-08-30 23:17     ` Michael Kelley
2026-08-30 23:39       ` Waiman Long

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=20260827195629.85E5A1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=sashiko-reviews@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 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.