@@ -1883,6 +1883,7 @@ static void __refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages)
drain_stock(stock);
}
+/* Should never be called with root_mem_cgroup. */
static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages)
{
unsigned long flags;
@@ -1892,8 +1893,6 @@ static void refill_stock(struct mem_cgroup *memcg, unsigned int nr_pages)
* 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);
refill_stock can not be called with root memcg, so there is no need to check it. Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev> --- mm/memcontrol.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)