mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Badole, Vishal" <vishal.badole@amd.com>
To: "Guo, Wangyang" <wangyang.guo@intel.com>,
	"tglx@kernel.org" <tglx@kernel.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "bp@alien8.de" <bp@alien8.de>,
	"Li, Tianyou" <tianyou.li@intel.com>,
	"tim.c.chen@linux.intel.com" <tim.c.chen@linux.intel.com>,
	"Liang, Dan" <dan.liang@intel.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH v2] lib/group_cpus: Snapshot cluster masks to keep grouping hotplug invariant
Date: Fri, 21 Aug 2026 23:11:38 +0530	[thread overview]
Message-ID: <95b780d8-e294-4368-a077-7db94f62b114@amd.com> (raw)
In-Reply-To: <DS0PR11MB8018E41AB42E110B167251DD92A42@DS0PR11MB8018.namprd11.prod.outlook.com>



On 8/20/2026 11:23 AM, Guo, Wangyang wrote:
>> +static void capture_cluster_snapshot(void) {
> 
>> +	/* Only capture when all present CPUs are online. */
>> +	if (!data_race(cpumask_equal(cpu_present_mask, cpu_online_mask)))
> ...
> What if there is an ABA problem, some CPU offline during the snapshot creation but becomes
> online before this check, snapshot may capture the torn data but below check still pass.
> 
>> +	/* Drop it if a CPU changed state mid-copy; never latch a torn view. */
>> +	if (!data_race(cpumask_equal(cpu_present_mask, cpu_online_mask))) {
>> +		for_each_possible_cpu(cpu)
>> +			free_cpumask_var(snapshot[cpu]);
>> +		kfree(snapshot);
>> +		goto out;
>> +	}
> 
> What about check snapshot against cpu_present_mask?

Hi Wangyang,
Thanks for the review. Both comments are valid - I will address them in
the next revision.


      reply	other threads:[~2026-08-21 17:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14 12:34 Vishal Badole
2026-08-20  5:53 ` Guo, Wangyang
2026-08-21 17:41   ` Badole, Vishal [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=95b780d8-e294-4368-a077-7db94f62b114@amd.com \
    --to=vishal.badole@amd.com \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=dan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@kernel.org \
    --cc=tianyou.li@intel.com \
    --cc=tim.c.chen@linux.intel.com \
    --cc=wangyang.guo@intel.com \
    /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

all inboxes | Powered by JetHome®