Re: [PATCH v2 1/2] Make the batch size of the percpu_counterconfigurable

From: Andrew Morton
Date: Tue May 21 2013 - 16:41:29 EST


On Fri, 3 May 2013 03:10:52 -0700 Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx> wrote:

> Currently, there is a single, global, variable (percpu_counter_batch) that
> controls the batch sizes for every 'struct percpu_counter' on the system.
>
> However, there are some applications, e.g. memory accounting where it is
> more appropriate to scale the batch size according to the memory size.
> This patch adds the infrastructure to be able to change the batch sizes
> for each individual instance of 'struct percpu_counter'.
>

This patch seems to add rather a lot of unnecessary code.

- The increase in the size of percu_counter is regrettable.

- The change to percpu_counter_startup() is unneeded - no
percpu_counters should exist at this time. (We may have screwed this
up - percpu_counter_startup() shuold probably be explicitly called
from start_kernel()).

- Once the percpu_counter_startup() change is removed, all that code
which got moved out of CONFIG_HOTPLUG_CPU can be put back.

And probably other stuff.


If you want to use a larger batch size for vm_committed_as, why not
just use the existing __percpu_counter_add(..., batch)? Easy.

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