lkml.org 
[lkml]   [2019]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 9/9] x86/apic: Use non-atomic operations when possible
On Tue, 25 Jun 2019, Dave Hansen wrote:

> > diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c
> > index 7685444a106b..609e499387a1 100644
> > --- a/arch/x86/kernel/apic/x2apic_cluster.c
> > +++ b/arch/x86/kernel/apic/x2apic_cluster.c
> > @@ -50,7 +50,7 @@ __x2apic_send_IPI_mask(const struct cpumask *mask, int vector, int apic_dest)
> > cpumask_copy(tmpmsk, mask);
> > /* If IPI should not be sent to self, clear current CPU */
> > if (apic_dest != APIC_DEST_ALLINC)
> > - cpumask_clear_cpu(smp_processor_id(), tmpmsk);
> > + __cpumask_clear_cpu(smp_processor_id(), tmpmsk);
>
> tmpmsk is on-stack, but it's a pointer to a per-cpu variable:
>
> tmpmsk = this_cpu_cpumask_var_ptr(ipi_mask);
>
> So this one doesn't appear as obviously correct as a mask which itself
> is on the stack. The other three look obviously OK, though.

It's still correct. The mask is per cpu and protected because interrupts
are disabled. I noticed and wanted to amend the change log and forgot.

Thanks,

tglx

\
 
 \ /
  Last update: 2019-06-26 00:03    [W:0.070 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site