Re: [patch 02/20] mm: close PageTail race

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrew,

On Mon, Mar 3, 2014 at 3:38 PM,  <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> From: David Rientjes <rientjes@xxxxxxxxxx>
> Subject: mm: close PageTail race
>
> Since "mm, compaction: avoid isolating pinned pages", it has been possible
> for page_count(page) to race with prep_compound_page() by finding
> PageTail(page) set with a NULL or dangling page->first_page.
>
> "mm, page_alloc: make first_page visible before PageTail" adds a store
> memory barrier to prep_compound_page() to ensure page->first_page is set,
> but nothing is preventing compound_head() from seeing a dangling head
> page.

Neither of the patches mentioned above has been merged into my tree,
so this commit message doesn't make a lot of sense.

Now, they are in your -mm tree, so presumably they will eventually
come to me, but quite frankly, this patch doesn't seem to *work*
without the second patch mentioned: this patch adds a "smp_rmb()" to
the compound_head() function, but the smp_wmb() it should pair with
comes from that "make first_page visible before PageTail" patch that
you haven't sent me.

So I'm at something of a loss as to what to do. The patch looks fine,
but it seems insane to merge it without the other patch that makes it
actually work.

It also seems insane to have the smp_rmb() and smp_wmb() added in
separate patches to begin with. A read barrier that orders reads is
only meaningful if the writes are ordered, and vice versa. So having
them as separate patches is confusing.

I'm going to drop this for now, but am hoping that you'll re-send this
together with (preferably as one patch) that "make first_page visible
before PageTail" patch. Especially as the "avoid isolating pinned
pages" also hasn't hit mainline, and is apparently the patch that
actually triggers the problem, so mainline presumably cannot hit the
race in the first place.

                    Linus
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]