Re: [PATCH 5/5] slub: Only IPI CPUs that have per cpu obj to flush

From: Peter Zijlstra
Date: Mon Sep 26 2011 - 03:34:20 EST


On Sun, 2011-09-25 at 11:54 +0300, Gilad Ben-Yossef wrote:
> + if (likely(zalloc_cpumask_var(&cpus, GFP_ATOMIC))) {
> + for_each_online_cpu(cpu) {
> + c = per_cpu_ptr(s->cpu_slab, cpu);
> + if (c && c->page)
> + cpumask_set_cpu(cpu, cpus);
> + }
> + on_each_cpu_mask(cpus, flush_cpu_slab, s, 1);
> + free_cpumask_var(cpus);

Right, having to do that for_each_oneline_cpu() loop only to then IPI
them can cause a massive cacheline bounce fest.. Ideally you'd want to
keep a cpumask per kmem_cache, although I bet the memory overhead of
that isn't attractive.

Also, what Pekka says, having that alloc here isn't good either.
--
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/