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

Re: [Xen-ia64-devel] [PATCH] fix I&D cache incoherency after vcpu migrat

To: Alex Williamson <alex.williamson@xxxxxx>
Subject: Re: [Xen-ia64-devel] [PATCH] fix I&D cache incoherency after vcpu migration
From: Kouya SHIMURA <kouya@xxxxxxxxxxxxxx>
Date: Thu, 15 Feb 2007 09:35:51 +0900
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 14 Feb 2007 16:35:42 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1171476989.5373.70.camel@bling>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <200702131204.l1DC4GLt025348@xxxxxxxxxxxxxxxxxxxxxxxxxx> <1171476989.5373.70.camel@bling>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi Alex,

next->arch.cache_coherent_map is a private data in struct vcpu.
Only PAL_CACHE_FLUSH set it and the other vcpus never touch it.
So it is not racy. 
I think it might be too exaggerated to use atomic cpu_test_and_clear().

Thanks, 
Kouya

Alex Williamson writes:
 > On Tue, 2007-02-13 at 21:15 +0900, Kouya SHIMURA wrote:
 > > +static void flush_cache_for_context_switch(struct vcpu *next)
 > > +{
 > > +       extern cpumask_t cpu_cache_coherent_map;
 > > +       int cpu = smp_processor_id();
 > > +
 > > +       if (is_idle_vcpu(next) ||
 > > +           __test_and_clear_bit(cpu, &next->arch.cache_coherent_map))
 > > { 
 > 
 > Hi Kouya,
 > 
 >    Isn't this racey?  Why use the non-atomic __test_and_clear_bit() here
 > rather than the atomic version?  Thanks,
 > 
 >      Alex
 > 
 > -- 
 > Alex Williamson                             HP Open Source & Linux Org.


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