Re: [PATCH FIXED] x86: use flush_tlb_others to implementflush_tlb_all

From: Ian Campbell
Date: Wed May 13 2009 - 04:53:19 EST


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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/