[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210911152426.gq34cigqteqvzms2@liuwe-devbox-debian-v2>
Date: Sat, 11 Sep 2021 15:24:26 +0000
From: Wei Liu <wei.liu@...nel.org>
To: Michael Kelley <mikelley@...rosoft.com>
Cc: Wei Liu <wei.liu@...nel.org>,
Linux on Hyper-V List <linux-hyperv@...r.kernel.org>,
KY Srinivasan <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Dexuan Cui <decui@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
"open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 2/2] x86/hyperv: remove on-stack cpumask from
hv_send_ipi_mask_allbutself
On Sat, Sep 11, 2021 at 03:09:50PM +0000, Michael Kelley wrote:
> From: Wei Liu <wei.liu@...nel.org> Sent: Friday, September 10, 2021 11:57 AM
[...]
> > -static bool __send_ipi_mask(const struct cpumask *mask, int vector)
> > +static bool __send_ipi_mask(const struct cpumask *mask, int vector,
> > + bool exclude_self)
> > {
> > - int cur_cpu, vcpu;
> > + int cur_cpu, vcpu, this_cpu = smp_processor_id();
> > struct hv_send_ipi ipi_arg;
> > u64 status;
> > + unsigned int weight;
> >
> > trace_hyperv_send_ipi_mask(mask, vector);
> >
> > - if (cpumask_empty(mask))
> > + weight = cpumask_weight(mask);
> > +
> > + /*
> > + * Do nothing if
> > + * 1. the mask is empty
> > + * 2. the mask only contains self when exclude_self is true
> > + */
> > + if (weight == 0 ||
> > + (exclude_self && weight == 1 && cpumask_first(mask) == this_cpu))
>
> Nit: cpumask_test_cpu(this_cpu, mask) would seem to be a better fit for this
> use case than cpumask_first(). But either works.
I will adjust the code when I commit this patch.
Wei.
Powered by blists - more mailing lists