RE: [PATCH 13/16] percpu: remove per_cpu__ prefix.

From: Luck, Tony
Date: Wed Oct 14 2009 - 12:44:25 EST


>> -#define __ia64_per_cpu_var(var) per_cpu__##var
>> +#define __ia64_per_cpu_var(var) var
>
> IA64 could completely drop the macro? Tony?

A #define that just returns its original argument untouched
does seem to be a no-op. So I suppose we could just fix
the dozen or so places where it is used to just use the
variable directly.

But that would leave no visual indicator in the source
code that a per-cpu variable was being used. E.g. in
delayed_tlb_flush() we'd end up with:

if (unlikely(ia64_need_tlb_flush)) {
spin_lock ...
if (ia64_need_tlb_flush) {
local_flush_tlb_all();
ia64_need_tlb_flush = 0;
}
spin_unlock ...
}

This might cause confusion to anyone who is looking at
this code and has let the

DECLARE_PER_CPU(u8, ia64_need_tlb_flush);

scroll off the top of their screen. I'd be tempted to go
and change all the names to make this obvious:

DECLARE_PER_CPU(u8, PERCPU_ia64_need_tlb_flush);


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