All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Weiner <hannes@cmpxchg.org>
To: Hugh Dickins <hughd@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Ying Han <yinghan@google.com>, Dave Jones <davej@redhat.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	Oleg Nesterov <oleg@redhat.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Subject: Re: [PATCH] [BUGFIX] update mm->owner even if no next owner.
Date: Sat, 11 Jun 2011 01:54:42 +0200	[thread overview]
Message-ID: <20110610235442.GA21413@cmpxchg.org> (raw)
In-Reply-To: <alpine.LSU.2.00.1106101425400.28334@sister.anvils>

On Fri, Jun 10, 2011 at 02:49:35PM -0700, Hugh Dickins wrote:
> On Fri, 10 Jun 2011, KAMEZAWA Hiroyuki wrote:
> > 
> > I think this can be a fix. 
> 
> Sorry, I think not: I've not digested your rationale,
> but three things stand out:
> 
> 1. Why has this only just started happening?  I may not have run that
>    test on 3.0-rc1, but surely I ran it for hours with 2.6.39;
>    maybe not with khugepaged, but certainly with ksmd.
> 
> 2. Your hunk below:
> > -	if (!mm_need_new_owner(mm, p))
> > +	if (!mm_need_new_owner(mm, p)) {
> > +		rcu_assign_pointer(mm->owner, NULL);
>    is now setting mm->owner to NULL at times when we were sure it did not
>    need updating before (task is not the owner): you're damaging mm->owner.
> 
> 3. There's a patch from Andrea in 3.0-rc1 which looks very likely to be
>    relevant, 692e0b35427a "mm: thp: optimize memcg charge in khugepaged".
>    I'll try reproducing without that tonight (I crashed in 20 minutes
>    this morning, so it's not too hard).

It looks likely.  This change moved the memcg charge out of the
mmap_sem read section, which kept the last task of the mm from
exiting:

	do_exit
	  exit_mm
	    mmput
	      khugepaged_exit
	        down_write(&mm->mmap_sem);
		up_write(&mm->mmap_sem);


WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <hannes@cmpxchg.org>
To: Hugh Dickins <hughd@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Ying Han <yinghan@google.com>, Dave Jones <davej@redhat.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	Oleg Nesterov <oleg@redhat.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Subject: Re: [PATCH] [BUGFIX] update mm->owner even if no next owner.
Date: Sat, 11 Jun 2011 01:54:42 +0200	[thread overview]
Message-ID: <20110610235442.GA21413@cmpxchg.org> (raw)
In-Reply-To: <alpine.LSU.2.00.1106101425400.28334@sister.anvils>

On Fri, Jun 10, 2011 at 02:49:35PM -0700, Hugh Dickins wrote:
> On Fri, 10 Jun 2011, KAMEZAWA Hiroyuki wrote:
> > 
> > I think this can be a fix. 
> 
> Sorry, I think not: I've not digested your rationale,
> but three things stand out:
> 
> 1. Why has this only just started happening?  I may not have run that
>    test on 3.0-rc1, but surely I ran it for hours with 2.6.39;
>    maybe not with khugepaged, but certainly with ksmd.
> 
> 2. Your hunk below:
> > -	if (!mm_need_new_owner(mm, p))
> > +	if (!mm_need_new_owner(mm, p)) {
> > +		rcu_assign_pointer(mm->owner, NULL);
>    is now setting mm->owner to NULL at times when we were sure it did not
>    need updating before (task is not the owner): you're damaging mm->owner.
> 
> 3. There's a patch from Andrea in 3.0-rc1 which looks very likely to be
>    relevant, 692e0b35427a "mm: thp: optimize memcg charge in khugepaged".
>    I'll try reproducing without that tonight (I crashed in 20 minutes
>    this morning, so it's not too hard).

It looks likely.  This change moved the memcg charge out of the
mmap_sem read section, which kept the last task of the mm from
exiting:

	do_exit
	  exit_mm
	    mmput
	      khugepaged_exit
	        down_write(&mm->mmap_sem);
		up_write(&mm->mmap_sem);

--
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:[~2011-06-10 23:54 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-09 21:29 3.0rc2 oops in mem_cgroup_from_task Dave Jones
2011-06-09 22:47 ` Ying Han
2011-06-09 22:47   ` Ying Han
2011-06-09 23:42   ` Ying Han
2011-06-09 23:42     ` Ying Han
2011-06-10  0:13     ` KAMEZAWA Hiroyuki
2011-06-10  0:13       ` KAMEZAWA Hiroyuki
2011-06-10  1:30       ` Hugh Dickins
2011-06-10  1:30         ` Hugh Dickins
2011-06-10  2:33         ` KAMEZAWA Hiroyuki
2011-06-10  2:33           ` KAMEZAWA Hiroyuki
2011-06-10  3:19           ` KAMEZAWA Hiroyuki
2011-06-10  3:19             ` KAMEZAWA Hiroyuki
2011-06-10  3:55             ` KAMEZAWA Hiroyuki
2011-06-10  3:55               ` KAMEZAWA Hiroyuki
2011-06-10  4:30               ` [PATCH] [BUGFIX] update mm->owner even if no next owner KAMEZAWA Hiroyuki
2011-06-10  4:30                 ` KAMEZAWA Hiroyuki
2011-06-10  5:06                 ` Daisuke Nishimura
2011-06-10  5:06                   ` Daisuke Nishimura
2011-06-10  5:21                 ` Xiaotian Feng
2011-06-10  5:22                   ` KAMEZAWA Hiroyuki
2011-06-10  5:22                     ` KAMEZAWA Hiroyuki
2011-06-10 21:49                 ` Hugh Dickins
2011-06-10 23:54                   ` Johannes Weiner [this message]
2011-06-10 23:54                     ` Johannes Weiner
2011-06-11 17:51                     ` Johannes Weiner
2011-06-11 17:51                       ` Johannes Weiner
2011-06-11 18:44                       ` Andrea Arcangeli
2011-06-11 18:44                         ` Andrea Arcangeli
2011-06-11 23:04                         ` Hiroyuki Kamezawa
2011-06-11 23:04                           ` Hiroyuki Kamezawa
2011-06-13  1:41                       ` Hugh Dickins
2011-06-13  1:54                         ` KAMEZAWA Hiroyuki
2011-06-13  1:54                           ` KAMEZAWA Hiroyuki
2011-06-13 14:03                           ` Hugh Dickins
2011-06-13 14:03                             ` Hugh Dickins
2011-06-11  0:46                   ` Hiroyuki Kamezawa
2011-06-11  0:46                     ` Hiroyuki Kamezawa
2011-06-11 16:04                     ` Hugh Dickins
2011-06-11 16:39                       ` Andrea Arcangeli
2011-06-11 16:39                         ` Andrea Arcangeli
2011-06-11 18:04                         ` Johannes Weiner
2011-06-11 18:04                           ` Johannes Weiner
2011-06-11  8:19 ` 3.0rc2 oops in mem_cgroup_from_task Michal Hocko
2011-06-11  8:19   ` Michal Hocko
2011-06-11 15:46   ` Hugh Dickins
2011-06-11 15:46     ` Hugh Dickins
2011-06-12  9:09     ` Michal Hocko
2011-06-12  9:09       ` Michal Hocko

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=20110610235442.GA21413@cmpxchg.org \
    --to=hannes@cmpxchg.org \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=davej@redhat.com \
    --cc=hughd@google.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=oleg@redhat.com \
    --cc=yinghan@google.com \
    /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.