[PATCH mmotm] memcg: avoid vmpressure oops when memcg disabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A CONFIG_MEMCG=y kernel booted with "cgroup_disable=memory" crashes on
a NULL memcg (but non-NULL root_mem_cgroup) when vmpressure kicks in.
Here's the patch I use to avoid that, but you might prefer a test on
mem_cgroup_disabled() somewhere.

Signed-off-by: Hugh Dickins <hughd@xxxxxxxxxx>
---
To be folded in to
mm-memcontrol-hook-up-vmpressure-to-socket-pressure.patch
if Hannes does not prefer to fix it differently.

 mm/vmpressure.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 4.4-next/mm/vmpressure.c	2016-01-06 10:32:21.387741753 -0800
+++ linux/mm/vmpressure.c	2016-01-06 10:48:05.956149779 -0800
@@ -260,7 +260,7 @@ void vmpressure(gfp_t gfp, struct mem_cg
 		enum vmpressure_levels level;
 
 		/* For now, no users for root-level efficiency */
-		if (memcg == root_mem_cgroup)
+		if (!memcg || memcg == root_mem_cgroup)
 			return;
 
 		spin_lock(&vmpr->sr_lock);

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]