Thread (11 messages) 11 messages, 3 authors, 2021-07-09

Re: [PATCH 1/3] mm, memcg: add mem_cgroup_disabled checks in vmpressure and swap-related functions

From: Shakeel Butt <hidden>
Date: 2021-07-09 16:00:56
Also in: linux-mm, lkml

On Thu, Jul 8, 2021 at 5:05 PM Suren Baghdasaryan [off-list ref] wrote:
[...]
quoted hunk ↗ jump to hunk
--- a/mm/vmpressure.c
+++ b/mm/vmpressure.c
@@ -240,7 +240,12 @@ static void vmpressure_work_fn(struct work_struct *work)
 void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, bool tree,
                unsigned long scanned, unsigned long reclaimed)
 {
-       struct vmpressure *vmpr = memcg_to_vmpressure(memcg);
+       struct vmpressure *vmpr;
+
+       if (mem_cgroup_disabled())
+               return;
+
+       vmpr = memcg_to_vmpressure(memcg);
I was wondering why this was not crashing but realized that we
allocate root_mem_cgroup even in cgroup_disable=memory case.

Reviewed-by: Shakeel Butt <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help