I need to move this up a bit, and I am doing in a separate patch just to reduce churn in the patch that needs it.
Signed-off-by: Vladimir Davydov <[email protected]> Cc: Glauber Costa <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Balbir Singh <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> --- mm/memcontrol.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 3a4e2f8..220b463 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2983,6 +2983,21 @@ static int memcg_cache_idx(struct mem_cgroup *memcg) return ret; } +static size_t memcg_caches_array_size(int num_groups) +{ + ssize_t size; + if (num_groups <= 0) + return 0; + + size = 2 * num_groups; + if (size < MEMCG_CACHES_MIN_SIZE) + size = MEMCG_CACHES_MIN_SIZE; + else if (size > MEMCG_CACHES_MAX_SIZE) + size = MEMCG_CACHES_MAX_SIZE; + + return size; +} + /* * This is a bit cumbersome, but it is rarely used and avoids a backpointer * in the memcg_cache_params struct. @@ -3125,21 +3140,6 @@ int memcg_update_cache_sizes(struct mem_cgroup *memcg) return 0; } -static size_t memcg_caches_array_size(int num_groups) -{ - ssize_t size; - if (num_groups <= 0) - return 0; - - size = 2 * num_groups; - if (size < MEMCG_CACHES_MIN_SIZE) - size = MEMCG_CACHES_MIN_SIZE; - else if (size > MEMCG_CACHES_MAX_SIZE) - size = MEMCG_CACHES_MAX_SIZE; - - return size; -} - /* * We should update the current array size iff all caches updates succeed. This * can only be done from the slab side. The slab mutex needs to be held when -- 1.7.10.4 _______________________________________________ Devel mailing list [email protected] https://lists.openvz.org/mailman/listinfo/devel
