Re: [PATCH] percpu: preemptless __per_cpu_counter_add

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 28 Apr 2011, Tejun Heo wrote:

> And I'm getting more and more frustrated.  THIS IS SLOW PATH.  If it's
> showing up on your profile, bump up @batch.  It doesn't make any sense
> to micro optimize slow path at the cost of introducing such nastiness.
> Unless someone can show me such nastiness doesn't exist, I'm not gonna
> take this change.

I think its dangerous to think about these counters as comparable to
atomics. The user always has to keep in mind that these counters are
fuzzy and the coder has to consider that for any use of these.

Simplifying the slow path (and the rest of the code) by dropping the
spinlock is a worthy goal and may allow inlining the whole _add function
at some point since it then becomes quite small and no longer needs to do
function calls. As a side effect: Seeing the code without a spinlock will
make sure that no one will assume that he will get atomic_t type
consistency from these counters. Having a lock in there seems to cause
strange expectations.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]