Re: [PATCH] percpu: preemptless __per_cpu_counter_add

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

 



On Fri, Apr 29, 2011 at 09:02:23AM -0500, Christoph Lameter wrote:
> On Fri, 29 Apr 2011, Tejun Heo wrote:
> We agree it seems that _sum is a pretty attempt to be more accurate but
> not really gets you total accuracy (atomic_t). Our experiences with adding
> a _sum

With concurrent updates, what is total accuracy anyway?  The order of
operations isn't defined.  Sure, atomic_t is serialized and in that
sense it might be totally accurate but without outer synchronization
the concurrent events it is counting aren't ordered.  Let's forget
about total accuracy.  I don't care and I don't think anyone should
care, but I do want reasonable output without out-of-place hiccups.

> free block count is always an estimate if it only uses percpu_counter
> without other serialization. "Pretty accurate" is saying you feel good
> about it. In fact the potential deviations are not that much different.

Well, I feel good for a reason - it doesn't hiccup on a single
touch(1) going on somewhere.

> 1. Bound the differential by time and size (we already have a batch notion
> here but we need to add a time boundary. Run a function over all counters
> every second or so that sums up the diffs).
> 
> 2. Use lockless operations for differentials and atomics for globals to
> make it scale well.
> 
> If someone wants more accuracy then we need the ability to dynamically set
> the batch limit similar to what the vm statistics do.

So, if you can remove _sum() by doing the above without introducing
excessive complexity or penalizing use cases which might not have too
much commonality with vmstat, by all means, but please pay attention
to the current users.  Actually take a look at them.

Also, if someone is gonna put considerable amount of effort into it,
please also invest some time into showing actual performance benefits,
or at least possibility of actual benefits.

Thanks.

-- 
tejun

--
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]