Re: [PATCH] percpu: add optimized generic percpu accessors

From: Tejun Heo
Date: Thu Jan 15 2009 - 16:54:23 EST


Ingo Molnar wrote:
>>> and "this is preempt safe" semantics.
>> Of course. But do any architectures actually _need_ that for a single
>> read?
>
> not for a read i guess - but for the other ops like add/and/or/xor.

FWIW, it prevents cross-cpu cacheline contamination. :-)

>> Maybe. And if so, they can interpose their arch-specific
>> implementation. But if the generic version is optimal for them, they
>> wouldn't need to..
>
> we cannot turn the generic ops into a single instruction so arch methods
> are preferable no matter how thick or thin the generic version is. But i
> agree that the optimization you suggest could be done.

I think the preemption protection is good to have there for, if
nothing else, documentation.

Thanks.

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