From: Mel Gorman <mgorman@suse.de>
To: Hugh Dickins <hughd@google.com>
Cc: Zhouping Liu <zliu@redhat.com>,
Alexander Beregalov <a.beregalov@gmail.com>,
Hillf Danton <dhillf@gmail.com>, Alex Xu <alex_y_xu@yahoo.ca>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Ingo Molnar <mingo@redhat.com>,
Johannes Weiner <jweiner@redhat.com>,
Michel Lespinasse <walken@google.com>,
Rik van Riel <riel@redhat.com>,
Andrea Arcangeli <aarcange@redhat.com>
Subject: Re: [PATCH] mm: thp: Acquire the anon_vma rwsem for lock during split
Date: Mon, 7 Jan 2013 14:36:43 +0000 [thread overview]
Message-ID: <20130107143643.GG3885@suse.de> (raw)
In-Reply-To: <alpine.LNX.2.00.1301041253280.4520@eggly.anvils>
On Fri, Jan 04, 2013 at 01:28:09PM -0800, Hugh Dickins wrote:
> I've added Alexander, Hillf and Alex to the Cc.
>
> On Fri, 4 Jan 2013, Mel Gorman wrote:
> > Zhouping, please test this patch.
> >
> > Andrea and Hugh, any comments on whether this could be improved?
>
> Your patch itself looks just right to me, no improvement required;
> and it's easy to understand how the bug crept in, from a blanket
> rwsem replacement of anon_vma mutex meeting the harmless-looking
> anon_vma_interval_tree_foreach in __split_huge_page, which looked
> as if it needed only the readlock provided by the usual method.
>
Indeed. Thanks Hugh for taking a look over it.
> But I'd fight shy myself of trying to describe all the THP locking
> conventions in the commit message: I haven't really tried to work
> out just how right you've got all those details.
>
I thought it was risky myself but it was the best way of getting Andrea
to object if I missed some subtlety! If I had infinite time I would
follow up with a patch to Documentation/vm/transhuge.txt explaining how
the anon_vma lock is used by THP.
> The actual race in question here was just two processes (one or both
> forked) doing split_huge_page() on the same THPage at the same time,
> wasn't it? (Though of course we only see the backtrace from one of
> them.) Which would be very confusing, and no surprise that the
> pmd_trans_splitting test ends up skipping pmds already updated by
> the racing process, so the mapcount doesn't match what's expected.
> Of course we need exclusive lock against that, which you give it.
>
Ok, thanks. Will resend to Andrew with some changelog edits.
--
Mel Gorman
SUSE Labs
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Mel Gorman <mgorman@suse.de>
To: Hugh Dickins <hughd@google.com>
Cc: Zhouping Liu <zliu@redhat.com>,
Alexander Beregalov <a.beregalov@gmail.com>,
Hillf Danton <dhillf@gmail.com>, Alex Xu <alex_y_xu@yahoo.ca>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Ingo Molnar <mingo@redhat.com>,
Johannes Weiner <jweiner@redhat.com>,
Michel Lespinasse <walken@google.com>,
Rik van Riel <riel@redhat.com>,
Andrea Arcangeli <aarcange@redhat.com>
Subject: Re: [PATCH] mm: thp: Acquire the anon_vma rwsem for lock during split
Date: Mon, 7 Jan 2013 14:36:43 +0000 [thread overview]
Message-ID: <20130107143643.GG3885@suse.de> (raw)
In-Reply-To: <alpine.LNX.2.00.1301041253280.4520@eggly.anvils>
On Fri, Jan 04, 2013 at 01:28:09PM -0800, Hugh Dickins wrote:
> I've added Alexander, Hillf and Alex to the Cc.
>
> On Fri, 4 Jan 2013, Mel Gorman wrote:
> > Zhouping, please test this patch.
> >
> > Andrea and Hugh, any comments on whether this could be improved?
>
> Your patch itself looks just right to me, no improvement required;
> and it's easy to understand how the bug crept in, from a blanket
> rwsem replacement of anon_vma mutex meeting the harmless-looking
> anon_vma_interval_tree_foreach in __split_huge_page, which looked
> as if it needed only the readlock provided by the usual method.
>
Indeed. Thanks Hugh for taking a look over it.
> But I'd fight shy myself of trying to describe all the THP locking
> conventions in the commit message: I haven't really tried to work
> out just how right you've got all those details.
>
I thought it was risky myself but it was the best way of getting Andrea
to object if I missed some subtlety! If I had infinite time I would
follow up with a patch to Documentation/vm/transhuge.txt explaining how
the anon_vma lock is used by THP.
> The actual race in question here was just two processes (one or both
> forked) doing split_huge_page() on the same THPage at the same time,
> wasn't it? (Though of course we only see the backtrace from one of
> them.) Which would be very confusing, and no surprise that the
> pmd_trans_splitting test ends up skipping pmds already updated by
> the racing process, so the mapcount doesn't match what's expected.
> Of course we need exclusive lock against that, which you give it.
>
Ok, thanks. Will resend to Andrew with some changelog edits.
--
Mel Gorman
SUSE Labs
next prev parent reply other threads:[~2013-01-07 14:36 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1621091901.34838094.1356409676820.JavaMail.root@redhat.com>
2012-12-25 4:38 ` kernel BUG at mm/huge_memory.c:1798! Zhouping Liu
2012-12-25 4:38 ` Zhouping Liu
2012-12-25 12:05 ` Hillf Danton
2012-12-25 12:05 ` Hillf Danton
2012-12-26 2:55 ` Zhouping Liu
2012-12-26 2:55 ` Zhouping Liu
2012-12-27 0:31 ` Alexander Beregalov
2012-12-27 0:31 ` Alexander Beregalov
2012-12-27 12:12 ` Hillf Danton
2012-12-27 12:12 ` Hillf Danton
2012-12-27 16:08 ` Alex Xu
2012-12-27 16:08 ` Alex Xu
2012-12-29 7:22 ` Hillf Danton
2012-12-29 7:22 ` Hillf Danton
2012-12-26 11:22 ` BUG: unable to handle kernel NULL pointer dereference at 0000000000000500 Zhouping Liu
2012-12-26 12:01 ` Hillf Danton
2012-12-26 12:01 ` Hillf Danton
2012-12-26 13:24 ` Zhouping Liu
2012-12-26 13:24 ` Zhouping Liu
2012-12-26 15:14 ` Hillf Danton
2012-12-26 15:14 ` Hillf Danton
2012-12-26 14:59 ` Zlatko Calusic
2012-12-26 14:59 ` Zlatko Calusic
2012-12-27 14:58 ` Zlatko Calusic
2012-12-27 14:58 ` Zlatko Calusic
2012-12-27 23:55 ` David R. Piegdon
2012-12-28 0:09 ` Zlatko Calusic
2012-12-28 0:09 ` Zlatko Calusic
2012-12-28 2:45 ` Zhouping Liu
2012-12-28 2:45 ` Zhouping Liu
2012-12-28 2:48 ` Zhouping Liu
2012-12-28 2:48 ` Zhouping Liu
2012-12-28 9:01 ` Zhouping Liu
2012-12-28 9:01 ` Zhouping Liu
2012-12-28 13:43 ` Zlatko Calusic
2012-12-28 13:43 ` Zlatko Calusic
2012-12-28 12:57 ` Zlatko Calusic
2012-12-28 12:57 ` Zlatko Calusic
2013-01-03 17:57 ` kernel BUG at mm/huge_memory.c:1798! Mel Gorman
2013-01-03 17:57 ` Mel Gorman
2013-01-04 14:08 ` [PATCH] mm: thp: Acquire the anon_vma rwsem for lock during split Mel Gorman
2013-01-04 14:08 ` Mel Gorman
2013-01-04 21:28 ` Hugh Dickins
2013-01-04 21:28 ` Hugh Dickins
2013-01-07 14:36 ` Mel Gorman [this message]
2013-01-07 14:36 ` Mel Gorman
2013-01-07 14:39 ` [PATCH] mm: thp: Acquire the anon_vma rwsem for write " Mel Gorman
2013-01-07 14:39 ` Mel Gorman
2013-01-05 1:32 ` [PATCH] mm: thp: Acquire the anon_vma rwsem for lock " Michel Lespinasse
2013-01-05 1:32 ` Michel Lespinasse
2013-01-05 12:24 ` Simon Jeons
2013-01-05 12:24 ` Simon Jeons
2013-01-07 15:09 ` Mel Gorman
2013-01-07 15:09 ` Mel Gorman
2013-01-07 15:08 ` Mel Gorman
2013-01-07 15:08 ` Mel Gorman
2013-01-05 5:51 ` Zhouping Liu
2013-01-05 5:51 ` Zhouping Liu
2013-01-07 14:38 ` Mel Gorman
2013-01-07 14:38 ` Mel Gorman
2013-01-05 12:21 ` Simon Jeons
2013-01-05 12:21 ` Simon Jeons
2013-01-04 16:58 ` kernel BUG at mm/huge_memory.c:1798! Zhouping Liu
2013-01-04 16:58 ` Zhouping Liu
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=20130107143643.GG3885@suse.de \
--to=mgorman@suse.de \
--cc=a.beregalov@gmail.com \
--cc=aarcange@redhat.com \
--cc=alex_y_xu@yahoo.ca \
--cc=dhillf@gmail.com \
--cc=hughd@google.com \
--cc=jweiner@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@redhat.com \
--cc=riel@redhat.com \
--cc=walken@google.com \
--cc=zliu@redhat.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.