Re: [PATCH FIXED] x86: use flush_tlb_others to implement flush_tlb_all

From: Jeremy Fitzhardinge
Date: Wed May 13 2009 - 13:36:35 EST


Ian Campbell wrote:
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();

Quite so. In theory gcc should be able to CSE smp_processor_id(), but the intent of get_cpu() is that you use its return value...

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