Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

memcg: remove root memcg check from refill_stock

refill_stock can not be called with root memcg, so there is no need to
check it. Instead add a warning if root is ever passed to it.

Link: https://lkml.kernel.org/r/20250404013913.1663035-1-shakeel.butt@linux.dev
Link: https://lkml.kernel.org/r/20250404013913.1663035-2-shakeel.butt@linux.dev
Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Shakeel Butt and committed by
Andrew Morton
e56fa8f5 aa8d89d1

+2 -2
+2 -2
mm/memcontrol.c
··· 1893 1893 { 1894 1894 unsigned long flags; 1895 1895 1896 + VM_WARN_ON_ONCE(mem_cgroup_is_root(memcg)); 1897 + 1896 1898 if (!local_trylock_irqsave(&memcg_stock.stock_lock, flags)) { 1897 1899 /* 1898 1900 * In case of unlikely failure to lock percpu stock_lock 1899 1901 * uncharge memcg directly. 1900 1902 */ 1901 - if (mem_cgroup_is_root(memcg)) 1902 - return; 1903 1903 page_counter_uncharge(&memcg->memory, nr_pages); 1904 1904 if (do_memsw_account()) 1905 1905 page_counter_uncharge(&memcg->memsw, nr_pages);