From: Ian Campbell Subject: Re: [PATCH FIXED] x86: use flush_tlb_others to implement flush_tlb_all Date: Wed, 13 May 2009 09:52:55 +0100 Message-ID: <1242204775.24976.7.camel@zakaz.uk.xensource.com> References: <4A09E5FE.2080507@goop.org> <4A0A0D7C.8050206@zytor.com> <4A0A154C.9080000@goop.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4A0A154C.9080000@goop.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jeremy Fitzhardinge Cc: Xen-devel , arch/x86 maintainers , Linux Kernel Mailing List , "H. Peter Anvin" , Ingo Molnar , the List-Id: xen-devel@lists.xenproject.org On Tue, 2009-05-12 at 20:33 -0400, Jeremy Fitzhardinge wrote: > -static void do_flush_tlb_all(void *info) > +void flush_tlb_all(void) > { > - unsigned long cpu = smp_processor_id(); > + /* flush_tlb_others expects preempt to be disabled */ > + get_cpu(); > + > + flush_tlb_others(cpu_online_mask, NULL, TLB_FLUSH_ALL); > > __flush_tlb_all(); > if (percpu_read(cpu_tlbstate.state) == TLBSTATE_LAZY) > - leave_mm(cpu); > -} > + leave_mm(smp_processor_id()); get_cpu() returns smp_processor_id() so wouldn't this be more normally written as: /* flush_tlb_others expects preempt to be disabled */ unsigned long cpu = get_cpu(); [....] if ([....] == TLBSTATE_LAZY) leave_mm(cpu) put_cpu(); Ian.