[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130107143643.GG3885@suse.de>
Date: Mon, 7 Jan 2013 14:36:43 +0000
From: Mel Gorman <mgorman@...e.de>
To: Hugh Dickins <hughd@...gle.com>
Cc: Zhouping Liu <zliu@...hat.com>,
Alexander Beregalov <a.beregalov@...il.com>,
Hillf Danton <dhillf@...il.com>, Alex Xu <alex_y_xu@...oo.ca>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Ingo Molnar <mingo@...hat.com>,
Johannes Weiner <jweiner@...hat.com>,
Michel Lespinasse <walken@...gle.com>,
Rik van Riel <riel@...hat.com>,
Andrea Arcangeli <aarcange@...hat.com>
Subject: Re: [PATCH] mm: thp: Acquire the anon_vma rwsem for lock during split
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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists