Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f35c3a8e authored by Qiang Huang's avatar Qiang Huang Committed by Linus Torvalds
Browse files

memcg, kmem: use is_root_cache instead of hard code



Signed-off-by: default avatarQiang Huang <h.huangqiang@huawei.com>
Reviewed-by: default avatarPekka Enberg <penberg@kernel.org>
Acked-by: default avatarDavid Rientjes <rientjes@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Glauber Costa <glommer@parallels.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2afc745f
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -59,6 +59,7 @@
#include <net/sock.h>
#include <net/sock.h>
#include <net/ip.h>
#include <net/ip.h>
#include <net/tcp_memcontrol.h>
#include <net/tcp_memcontrol.h>
#include "slab.h"


#include <asm/uaccess.h>
#include <asm/uaccess.h>


@@ -3131,7 +3132,7 @@ int memcg_update_cache_size(struct kmem_cache *s, int num_groups)
{
{
	struct memcg_cache_params *cur_params = s->memcg_params;
	struct memcg_cache_params *cur_params = s->memcg_params;


	VM_BUG_ON(s->memcg_params && !s->memcg_params->is_root_cache);
	VM_BUG_ON(!is_root_cache(s));


	if (num_groups > memcg_limited_groups_array_size) {
	if (num_groups > memcg_limited_groups_array_size) {
		int i;
		int i;