Re: [patch v3 3/3] percpu_counter: use percpu data to track addstart

From: Eric Dumazet
Date: Tue May 17 2011 - 04:59:37 EST


Le mardi 17 mai 2011 Ã 16:41 +0800, Shaohua Li a Ãcrit :
> piÃce jointe document texte brut (percpu-counter-percpustart.patch)
> add_start causes a lot of cache bouncing because it's updated by all
> cpus. We can actually make it a percpu variable. This will completely
> reduce the cache bouncing.
> With the patch and last patch, I get about 7x faster running the
> workload that last patch described. Only with last patch, the workload
> is only about 4x faster.
> This doesn't slow down _sum because we removed lock for _sum. I did
> a stress test. 23 CPU run _add, one cpu runs _sum. In _add fast path
> (don't hold) lock, _sum runs a little slow (about 20% slower). In
> _add slow path (hold lock), _sum runs much faster (about 9x faster);
>
> V2: uses one percpu data as Eric suggested.

I NACK this patch very much.



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