Re: [PATCH] THP: fix comment about memory barrier

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

 



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@xxxxxxx>
> Cc: Hugh Dickins <hughd@xxxxxxxxxx>
> Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
> Cc: David Rientjes <rientjes@xxxxxxxxxx>
> Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
> Acked-by: Andrea Arcangeli <aarcange@xxxxxxxxxx>
> Signed-off-by: Minchan Kim <minchan@xxxxxxxxxx>

Acked-by: David Rientjes <rientjes@xxxxxxxxxx>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]