WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, "Liu, Jinsong" <jinsong.liu@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] Re: [PATCH] Fix cpu hotplug bug of mtrr update inconsistency
From: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Date: Tue, 1 Jun 2010 17:31:15 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc:
Delivery-date: Tue, 01 Jun 2010 02:32:53 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C82A8EFC.1659B%keir.fraser@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <BC00F5384FCFC9499AF06F92E8B78A9E062ADFC37F@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <C82A8EFC.1659B%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcsBY4JCH46cmVkHTAyPKp/cXkDMoQAB+ehDAAAxVwA=
Thread-topic: [Xen-devel] Re: [PATCH] Fix cpu hotplug bug of mtrr update inconsistency

>-----Original Message-----
>From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>[mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Keir Fraser
>Sent: Tuesday, June 01, 2010 5:19 PM
>To: Liu, Jinsong; xen-devel@xxxxxxxxxxxxxxxxxxx
>Subject: [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?

Yes, not caused by the new changes.

>
>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:

There is a cpu_hotplug lock held when mtrr_add/del_page, but that lock is NULL 
now. 
One argument is, because the mtrr_add/del_page and the cpu_o*ling request all 
from dom0, if dom0 should sync all vCPUs before mtrr_a/d_page, it should be 
safe that there is no race. But not sure about dom0's operation. 

--jyh

> - 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

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