mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 15:41:52 +02:00
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>
This commit is contained in:
parent
aa8d89d147
commit
e56fa8f5e1
|
|
@ -1893,13 +1893,13 @@ static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages)
|
|||
{
|
||||
unsigned long flags;
|
||||
|
||||
VM_WARN_ON_ONCE(mem_cgroup_is_root(memcg));
|
||||
|
||||
if (!local_trylock_irqsave(&memcg_stock.stock_lock, flags)) {
|
||||
/*
|
||||
* In case of unlikely failure to lock percpu stock_lock
|
||||
* uncharge memcg directly.
|
||||
*/
|
||||
if (mem_cgroup_is_root(memcg))
|
||||
return;
|
||||
page_counter_uncharge(&memcg->memory, nr_pages);
|
||||
if (do_memsw_account())
|
||||
page_counter_uncharge(&memcg->memsw, nr_pages);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user