Mailing List Archive

[Xen-merge] Re: [patch] SMP alternatives for i386
The SMP problems with self modifying code are very real but the hotplug
architecture for CPU already deals with these synchronizations and you
can use the SMP cross calls to 'capture' the other processors. The x86
case of processors with differing feature sets is extremely common on
PII/PIII systems and can also occur on other platforms where features
like SSE3 were introduced in later steppings. Clean alternatives support
for such platforms automatically would be good.

Other than that it looks sane to me (well the CPU hotplug case is silly
but the rest makes sense). The various CPU errata come out ok that I can
see as well because they use rmb/wmb/etc and those don't change
behaviour so still maintain store order against the bus.


_______________________________________________
Xen-merge mailing list
Xen-merge@lists.xensource.com
http://lists.xensource.com/xen-merge
[Xen-merge] Re: [patch] SMP alternatives for i386 [ In reply to ]
diff -urN -x 'build-*' -x '*~' -x Make -x scripts linux-2.6.15-rc5/arch/i386/kernel/smpboot.c work-2.6.15-rc5/arch/i386/kernel/smpboot.c
--- linux-2.6.15-rc5/arch/i386/kernel/smpboot.c 2005-12-06 17:00:36.000000000 +0100
+++ work-2.6.15-rc5/arch/i386/kernel/smpboot.c 2005-12-06 17:06:48.000000000 +0100
@@ -1351,6 +1352,9 @@
fixup_irqs(map);
/* It's now safe to remove this processor from the online map */
cpu_clear(cpu, cpu_online_map);
+
+ if (1 == num_online_cpus())
+ alternatives_smp_switch(0);
return 0;
}

Is that really safe there? Ideally you want to do the switch when the
processor going offline is no longer executing kernel code.


_______________________________________________
Xen-merge mailing list
Xen-merge@lists.xensource.com
http://lists.xensource.com/xen-merge
Re: [Xen-merge] Re: [patch] SMP alternatives for i386 [ In reply to ]
On 14 Dec 2005, at 19:35, Zwane Mwaikambo wrote:

> diff -urN -x 'build-*' -x '*~' -x Make -x scripts
> linux-2.6.15-rc5/arch/i386/kernel/smpboot.c
> work-2.6.15-rc5/arch/i386/kernel/smpboot.c
> --- linux-2.6.15-rc5/arch/i386/kernel/smpboot.c 2005-12-06
> 17:00:36.000000000 +0100
> +++ work-2.6.15-rc5/arch/i386/kernel/smpboot.c 2005-12-06
> 17:06:48.000000000 +0100
> @@ -1351,6 +1352,9 @@
> fixup_irqs(map);
> /* It's now safe to remove this processor from the online map */
> cpu_clear(cpu, cpu_online_map);
> +
> + if (1 == num_online_cpus())
> + alternatives_smp_switch(0);
> return 0;
> }
>
> Is that really safe there? Ideally you want to do the switch when the
> processor going offline is no longer executing kernel code.

Perhaps that check belongs at the end of __cpu_die()? That's where it
lives in xen's smpboot.c.

-- Keir


_______________________________________________
Xen-merge mailing list
Xen-merge@lists.xensource.com
http://lists.xensource.com/xen-merge
Re: [Xen-merge] Re: [patch] SMP alternatives for i386 [ In reply to ]
Hello Keir,

On Wed, 14 Dec 2005, Keir Fraser wrote:

> > fixup_irqs(map);
> > /* It's now safe to remove this processor from the online map */
> > cpu_clear(cpu, cpu_online_map);
> > +
> > + if (1 == num_online_cpus())
> > + alternatives_smp_switch(0);
> > return 0;
> > }
> >
> > Is that really safe there? Ideally you want to do the switch when the
> > processor going offline is no longer executing kernel code.
>
> Perhaps that check belongs at the end of __cpu_die()? That's where it lives in
> xen's smpboot.c.

Yes indeed, end of __cpu_die would be perfect for x86 too as that's where
CPU_DEAD acknowledge is checked.


_______________________________________________
Xen-merge mailing list
Xen-merge@lists.xensource.com
http://lists.xensource.com/xen-merge
Re: [Xen-merge] Re: [patch] SMP alternatives for i386 [ In reply to ]
>>> + if (1 == num_online_cpus())
>>> + alternatives_smp_switch(0);

> Yes indeed, end of __cpu_die would be perfect for x86 too as that's where
> CPU_DEAD acknowledge is checked.

Good point, fixed patch attached.

cheers,

Gerd