From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx192.postini.com [74.125.245.192]) by kanga.kvack.org (Postfix) with SMTP id 9A4E56B0111 for ; Fri, 5 Apr 2013 15:52:27 -0400 (EDT) Received: by mail-pa0-f45.google.com with SMTP id kl13so2212036pab.18 for ; Fri, 05 Apr 2013 12:52:26 -0700 (PDT) Date: Fri, 5 Apr 2013 12:52:24 -0700 (PDT) From: David Rientjes Subject: Re: [PATCH] THP: fix comment about memory barrier In-Reply-To: <1365149799-839-1-git-send-email-minchan@kernel.org> Message-ID: References: <1365149799-839-1-git-send-email-minchan@kernel.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Minchan Kim Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Mel Gorman , Hugh Dickins , Kamezawa Hiroyuki , Peter Zijlstra 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 > Cc: Hugh Dickins > Cc: Kamezawa Hiroyuki > Cc: David Rientjes > Cc: Peter Zijlstra > Acked-by: Andrea Arcangeli > Signed-off-by: Minchan Kim Acked-by: David Rientjes -- 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: email@kvack.org