Messages in this thread | | | Date | Tue, 21 May 2013 13:41:22 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH v2 1/2] Make the batch size of the percpu_counter configurable |
| |
On Fri, 3 May 2013 03:10:52 -0700 Tim Chen <tim.c.chen@linux.intel.com> 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.
| |