All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Down <chris@chrisdown.name>
To: Naresh Kamboju <naresh.kamboju@linaro.org>
Cc: Yafang Shao <laoar.shao@gmail.com>,
	Michal Hocko <mhocko@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Roman Gushchin <guro@fb.com>, linux-mm <linux-mm@kvack.org>,
	Cgroups <cgroups@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	lkft-triage@lists.linaro.org
Subject: Re: [PATCH v3 2/2] mm, memcg: Decouple e{low,min} state mutations from protection checks
Date: Fri, 22 May 2020 12:45:44 +0100	[thread overview]
Message-ID: <20200522114544.GA1112005@chrisdown.name> (raw)
In-Reply-To: <CA+G9fYseWc_7yq0M5Onju_HxbFid6DbuuaEFf-KUpqfxdF-QTg@mail.gmail.com>

Naresh Kamboju writes:
>This patch is causing oom-killer while running mkfs -t ext4 on i386 kernel
>running on x86_64 machine version linux-next 5.7.0-rc6-next-20200521.

I think I see what's wrong here -- if we bail out early, memory.e{min,low} 
might be uninitialised.

Does this patch fix it, by any chance?

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index d3b23c57bed4..aa902b9cbb79 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5046,6 +5046,9 @@ mem_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)
  			memory_cgrp_subsys.broken_hierarchy = true;
  	}
  
+	memcg->memory.emin = 0;
+	memcg->memory.elow = 0;
+
  	/* The following stuff does not apply to the root */
  	if (!parent) {
  #ifdef CONFIG_MEMCG_KMEM
-- 
2.26.2


WARNING: multiple messages have this Message-ID (diff)
From: Chris Down <chris-6Bi1550iOqEnzZ6mRAm98g@public.gmane.org>
To: Naresh Kamboju <naresh.kamboju-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Yafang Shao <laoar.shao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Michal Hocko <mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
	Roman Gushchin <guro-b10kYP2dOMg@public.gmane.org>,
	linux-mm <linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org>,
	Cgroups <cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	open list <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	lkft-triage-cunTk1MwBs8s++Sfvej+rw@public.gmane.org
Subject: Re: [PATCH v3 2/2] mm, memcg: Decouple e{low,min} state mutations from protection checks
Date: Fri, 22 May 2020 12:45:44 +0100	[thread overview]
Message-ID: <20200522114544.GA1112005@chrisdown.name> (raw)
In-Reply-To: <CA+G9fYseWc_7yq0M5Onju_HxbFid6DbuuaEFf-KUpqfxdF-QTg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Naresh Kamboju writes:
>This patch is causing oom-killer while running mkfs -t ext4 on i386 kernel
>running on x86_64 machine version linux-next 5.7.0-rc6-next-20200521.

I think I see what's wrong here -- if we bail out early, memory.e{min,low} 
might be uninitialised.

Does this patch fix it, by any chance?

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index d3b23c57bed4..aa902b9cbb79 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5046,6 +5046,9 @@ mem_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)
  			memory_cgrp_subsys.broken_hierarchy = true;
  	}
  
+	memcg->memory.emin = 0;
+	memcg->memory.elow = 0;
+
  	/* The following stuff does not apply to the root */
  	if (!parent) {
  #ifdef CONFIG_MEMCG_KMEM
-- 
2.26.2


  reply	other threads:[~2020-05-22 11:45 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05  8:41 [PATCH v3 0/2] mm: memcontrol: memory.{low,min} reclaim fix & cleanup Yafang Shao
2020-05-05  8:41 ` [PATCH v3 1/2] mm, memcg: Avoid stale protection values when cgroup is above protection Yafang Shao
2020-05-05  8:41 ` [PATCH v3 2/2] mm, memcg: Decouple e{low,min} state mutations from protection checks Yafang Shao
2020-05-05  8:41   ` Yafang Shao
2020-05-22 11:01   ` Naresh Kamboju
2020-05-22 11:01     ` Naresh Kamboju
2020-05-22 11:01     ` Naresh Kamboju
2020-05-22 11:45     ` Chris Down [this message]
2020-05-22 11:45       ` Chris Down
2020-05-22 15:41       ` Naresh Kamboju
2020-05-22 15:41         ` Naresh Kamboju
2020-05-22 12:18     ` Yafang Shao
2020-05-22 12:18       ` Yafang Shao
2020-05-22 12:18       ` Yafang Shao
2020-05-22 15:52       ` Naresh Kamboju
2020-05-22 15:52         ` Naresh Kamboju
2020-05-22 15:59         ` Yafang Shao
2020-05-22 15:59           ` Yafang Shao
2020-05-22 15:59           ` Yafang Shao
2020-05-22 16:06           ` Chris Down
2020-05-22 16:06             ` Chris Down
2020-05-22 16:07             ` Chris Down
2020-05-22 16:07               ` Chris Down
2020-05-22 16:27               ` Yafang Shao
2020-05-22 16:27                 ` Yafang Shao
2020-05-22 16:27                 ` Yafang Shao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200522114544.GA1112005@chrisdown.name \
    --to=chris@chrisdown.name \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=laoar.shao@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lkft-triage@lists.linaro.org \
    --cc=mhocko@kernel.org \
    --cc=naresh.kamboju@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.