[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.02.1304051252100.21173@chino.kir.corp.google.com>
Date: Fri, 5 Apr 2013 12:52:24 -0700 (PDT)
From: David Rientjes <rientjes@...gle.com>
To: Minchan Kim <minchan@...nel.org>
cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Mel Gorman <mgorman@...e.de>, Hugh Dickins <hughd@...gle.com>,
Kamezawa Hiroyuki <kamezawa.hiroyu@...fujitsu.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [PATCH] THP: fix comment about memory barrier
On Fri, 5 Apr 2013, Minchan Kim wrote:
> Now, memory barrier in __do_huge_pmd_anonymous_page doesn't work.
> Because lru_cache_add_lru uses pagevec so it could miss spinlock
> easily so above rule was broken so user might see inconsistent data.
>
> I was not first person who pointed out the problem. Mel and Peter
> pointed out a few months ago and Peter pointed out further that
> even spin_lock/unlock can't make sure it.
> http://marc.info/?t=134333512700004
>
> In particular:
>
> *A = a;
> LOCK
> UNLOCK
> *B = b;
>
> may occur as:
>
> LOCK, STORE *B, STORE *A, UNLOCK
>
> At last, Hugh pointed out that even we don't need memory barrier
> in there because __SetPageUpdate already have done it from
> Nick's [1] explicitly.
>
> So this patch fixes comment on THP and adds same comment for
> do_anonymous_page, too because everybody except Hugh was missing
> that. It means we needs COMMENT about that.
>
> [1] 0ed361dec "mm: fix PageUptodate data race"
>
> Cc: Mel Gorman <mgorman@...e.de>
> Cc: Hugh Dickins <hughd@...gle.com>
> Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
> Cc: David Rientjes <rientjes@...gle.com>
> Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> Acked-by: Andrea Arcangeli <aarcange@...hat.com>
> Signed-off-by: Minchan Kim <minchan@...nel.org>
Acked-by: David Rientjes <rientjes@...gle.com>
--
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