From: Johannes Weiner <jweiner@redhat.com>
To: Andrea Arcangeli <aarcange@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Hugh Dickins <hughd@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
David Rientjes <rientjes@google.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Minchan Kim <minchan.kim@gmail.com>
Subject: Re: [PATCH] thp+memcg-numa: fix BUG at include/linux/mm.h:370!
Date: Mon, 14 Mar 2011 20:58:23 +0100 [thread overview]
Message-ID: <20110314195823.GC2140@redhat.com> (raw)
In-Reply-To: <20110314171730.GF10696@random.random>
On Mon, Mar 14, 2011 at 06:17:31PM +0100, Andrea Arcangeli wrote:
> On Mon, Mar 14, 2011 at 09:56:10AM -0700, Linus Torvalds wrote:
> > Does mem_cgroup_newpage_charge() even _need_ the mmap_sem at all? And
> > if not, why not release the read-lock early? And even if it _does_
> > need it, why not do
[...]
> About mem_cgroup_newpage_charge I think you're right it won't need the
> mmap_sem. Running it under it is sure safe. But if it's not needed we
> can move the up_read before the mem_cgroup_newpage_charge like you
> suggested. Johannes/Minchan could you confirm the mmap_sem isn't
> needed around mem_cgroup_newpage_charge? The mm and new_page are
> stable without the mmap_sem, only the vma goes away but the memcg
> shouldn't care.
We don't care about the vma. It's all about assigning the physical
page to the memcg that mm->owner belongs to.
It would be the first callsite not holding the mmap_sem, but that is
only because all existing sites are fault handlers that don't drop the
lock for other reasons.
I am not aware of anything that would rely on the lock in there, or
would not deserve to break if it did.
WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <jweiner@redhat.com>
To: Andrea Arcangeli <aarcange@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Hugh Dickins <hughd@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
David Rientjes <rientjes@google.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Minchan Kim <minchan.kim@gmail.com>
Subject: Re: [PATCH] thp+memcg-numa: fix BUG at include/linux/mm.h:370!
Date: Mon, 14 Mar 2011 20:58:23 +0100 [thread overview]
Message-ID: <20110314195823.GC2140@redhat.com> (raw)
In-Reply-To: <20110314171730.GF10696@random.random>
On Mon, Mar 14, 2011 at 06:17:31PM +0100, Andrea Arcangeli wrote:
> On Mon, Mar 14, 2011 at 09:56:10AM -0700, Linus Torvalds wrote:
> > Does mem_cgroup_newpage_charge() even _need_ the mmap_sem at all? And
> > if not, why not release the read-lock early? And even if it _does_
> > need it, why not do
[...]
> About mem_cgroup_newpage_charge I think you're right it won't need the
> mmap_sem. Running it under it is sure safe. But if it's not needed we
> can move the up_read before the mem_cgroup_newpage_charge like you
> suggested. Johannes/Minchan could you confirm the mmap_sem isn't
> needed around mem_cgroup_newpage_charge? The mm and new_page are
> stable without the mmap_sem, only the vma goes away but the memcg
> shouldn't care.
We don't care about the vma. It's all about assigning the physical
page to the memcg that mm->owner belongs to.
It would be the first callsite not holding the mmap_sem, but that is
only because all existing sites are fault handlers that don't drop the
lock for other reasons.
I am not aware of anything that would rely on the lock in there, or
would not deserve to break if it did.
--
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>
next prev parent reply other threads:[~2011-03-14 19:58 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-14 8:08 [PATCH] thp+memcg-numa: fix BUG at include/linux/mm.h:370! Hugh Dickins
2011-03-14 8:08 ` Hugh Dickins
2011-03-14 15:25 ` Minchan Kim
2011-03-14 15:25 ` Minchan Kim
2011-03-14 15:52 ` Andrea Arcangeli
2011-03-14 15:52 ` Andrea Arcangeli
2011-03-14 16:37 ` Hugh Dickins
2011-03-14 16:37 ` Hugh Dickins
2011-03-14 16:56 ` Linus Torvalds
2011-03-14 16:56 ` Linus Torvalds
2011-03-14 17:17 ` Andrea Arcangeli
2011-03-14 17:17 ` Andrea Arcangeli
2011-03-14 19:58 ` Johannes Weiner [this message]
2011-03-14 19:58 ` Johannes Weiner
2011-03-14 23:42 ` KAMEZAWA Hiroyuki
2011-03-14 23:42 ` KAMEZAWA Hiroyuki
2011-04-01 21:21 ` Andrea Arcangeli
2011-04-01 21:21 ` Andrea Arcangeli
2011-03-14 16:59 ` [PATCH] mm: PageBuddy and mapcount underflows robustness Andrea Arcangeli
2011-03-14 16:59 ` Andrea Arcangeli
2011-03-14 17:30 ` Linus Torvalds
2011-03-14 17:30 ` Linus Torvalds
2011-03-17 23:16 ` Andrea Arcangeli
2011-03-17 23:16 ` Andrea Arcangeli
2011-03-18 21:34 ` Hugh Dickins
2011-03-18 21:34 ` Hugh Dickins
2011-03-23 22:58 ` [stable] " Greg KH
2011-03-23 22:58 ` Greg KH
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=20110314195823.GC2140@redhat.com \
--to=jweiner@redhat.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan.kim@gmail.com \
--cc=rientjes@google.com \
--cc=torvalds@linux-foundation.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.