linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@suse.cz>,
	linux-mm@kvack.org
Subject: Re: [PATCH 2/4] memcg: fix NULL mem_cgroup_try_charge
Date: Thu, 5 Jan 2012 14:56:46 +0900	[thread overview]
Message-ID: <20120105145646.40a47300.kamezawa.hiroyu@jp.fujitsu.com> (raw)
In-Reply-To: <alpine.LSU.2.00.1112281620400.8257@eggly.anvils>

On Wed, 28 Dec 2011 16:21:57 -0800 (PST)
Hugh Dickins <hughd@google.com> wrote:

> There is one way out of __mem_cgroup_try_charge() which claims success
> but still leaves memcg NULL, causing oops thereafter: make sure that
> it is set to root_mem_cgroup in this case.
> 
> Signed-off-by: Hugh Dickins <hughd@google.com>

Acked-by: KAMEZWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

> ---
> Fix to memcg: return -EINTR at bypassing try_charge()
> 
>  mm/memcontrol.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> --- mmotm.orig/mm/memcontrol.c	2011-12-28 12:53:23.420367847 -0800
> +++ mmotm/mm/memcontrol.c	2011-12-28 14:41:19.803018025 -0800
> @@ -2263,7 +2263,9 @@ again:
>  		 * task-struct. So, mm->owner can be NULL.
>  		 */
>  		memcg = mem_cgroup_from_task(p);
> -		if (!memcg || mem_cgroup_is_root(memcg)) {
> +		if (!memcg)
> +			memcg = root_mem_cgroup;
> +		if (mem_cgroup_is_root(memcg)) {
>  			rcu_read_unlock();
>  			goto done;
>  		}
> 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2012-01-05  5:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-29  0:17 [PATCH 0/4] memcg: four fixes to current next Hugh Dickins
2011-12-29  0:20 ` [PATCH 1/4] memcg: fix split_huge_page_refcounts Hugh Dickins
2012-01-05  5:55   ` KAMEZAWA Hiroyuki
2011-12-29  0:21 ` [PATCH 2/4] memcg: fix NULL mem_cgroup_try_charge Hugh Dickins
2012-01-05  5:56   ` KAMEZAWA Hiroyuki [this message]
2011-12-29  0:23 ` [PATCH 3/4] memcg: fix page migration to reset_owner Hugh Dickins
2012-01-05  6:00   ` KAMEZAWA Hiroyuki
2011-12-29  0:26 ` [PATCH 4/4] memcg: fix mem_cgroup_print_bad_page Hugh Dickins
2012-01-05  6:01   ` KAMEZAWA Hiroyuki

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=20120105145646.40a47300.kamezawa.hiroyu@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox