[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Re: [PATCH] Fix cpu hotplug bug of mtrr update inconsistency



On 01/06/2010 09:22, "Liu, Jinsong" <jinsong.liu@xxxxxxxxx> wrote:

> Fix cpu hotplug bug of mtrr update inconsistency
> 
> c/s 20021 changes some mtrr update logic.
> A bug is, when a cpu hot-add and then mtrr update, another cpu hot-add may
> break cpu_online_map
> consistency and result in deadlock.
> This patch is used to fix the bug. It move 'mtrr_ap_init' back to bp-ap sync
> stage protected by
> CPU_STATE_CALLOUT and CPU_STATE_CALLIN, and then keep consistency.

This is an old bug, rather than introduced by my changes, right?

I suggest we leave the call where it is, and fix set_mtrr() to not race CPUs
coming online. It is called elsewhere other than mtrr_ap_init() after all.
Also if you call mtrr_ap_init() before being in cpu_online_map, you then
race further MTRR changes:
 - CPU X calls mtrr_ap_init()
 - CPU Y calls set_mtrr() to actually change an MTRR.
 - CPU X adds itself to cpu_online_map
 - Aiee, CPU X is missing Y's update

I'll make a patch.

By the way, our MTRR subsystem is really pants! :-/

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.