Re: [RFC PATCH v3] mm: use READ_ONCE in page_cpupid_xchg_last()

2016-12-07 Thread Rasmus Villemoes
On Wed, Dec 07 2016, Christian Borntraeger wrote: > On 12/07/2016 10:59 AM, Michal Hocko wrote: >> On Wed 07-12-16 10:40:47, Christian Borntraeger wrote: >>> On 12/07/2016 10:29 AM, Vlastimil Babka wrote: On 12/07/2016 09:58 AM, Michal Hocko wrote: > On Wed 07-12-16 09:48:52, Vlastimil B

Re: [RFC PATCH v3] mm: use READ_ONCE in page_cpupid_xchg_last()

2016-12-07 Thread Christian Borntraeger
On 12/07/2016 10:59 AM, Michal Hocko wrote: > On Wed 07-12-16 10:40:47, Christian Borntraeger wrote: >> On 12/07/2016 10:29 AM, Vlastimil Babka wrote: >>> On 12/07/2016 09:58 AM, Michal Hocko wrote: On Wed 07-12-16 09:48:52, Vlastimil Babka wrote: > On 12/07/2016 09:43 AM, Michal Hocko wro

Re: [RFC PATCH v3] mm: use READ_ONCE in page_cpupid_xchg_last()

2016-12-07 Thread Michal Hocko
On Wed 07-12-16 10:40:47, Christian Borntraeger wrote: > On 12/07/2016 10:29 AM, Vlastimil Babka wrote: > > On 12/07/2016 09:58 AM, Michal Hocko wrote: > >> On Wed 07-12-16 09:48:52, Vlastimil Babka wrote: > >>> On 12/07/2016 09:43 AM, Michal Hocko wrote: > On Tue 06-12-16 09:53:14, Xishi Qiu

Re: [RFC PATCH v3] mm: use READ_ONCE in page_cpupid_xchg_last()

2016-12-07 Thread Christian Borntraeger
On 12/07/2016 10:29 AM, Vlastimil Babka wrote: > On 12/07/2016 09:58 AM, Michal Hocko wrote: >> On Wed 07-12-16 09:48:52, Vlastimil Babka wrote: >>> On 12/07/2016 09:43 AM, Michal Hocko wrote: On Tue 06-12-16 09:53:14, Xishi Qiu wrote: > A compiler could re-read "old_flags" from the memory

Re: [RFC PATCH v3] mm: use READ_ONCE in page_cpupid_xchg_last()

2016-12-07 Thread Vlastimil Babka
On 12/07/2016 09:58 AM, Michal Hocko wrote: > On Wed 07-12-16 09:48:52, Vlastimil Babka wrote: >> On 12/07/2016 09:43 AM, Michal Hocko wrote: >>> On Tue 06-12-16 09:53:14, Xishi Qiu wrote: A compiler could re-read "old_flags" from the memory location after reading and calculation "flags"

Re: [RFC PATCH v3] mm: use READ_ONCE in page_cpupid_xchg_last()

2016-12-07 Thread Michal Hocko
On Wed 07-12-16 09:48:52, Vlastimil Babka wrote: > On 12/07/2016 09:43 AM, Michal Hocko wrote: > > On Tue 06-12-16 09:53:14, Xishi Qiu wrote: > >> A compiler could re-read "old_flags" from the memory location after reading > >> and calculation "flags" and passes a newer value into the cmpxchg makin

Re: [RFC PATCH v3] mm: use READ_ONCE in page_cpupid_xchg_last()

2016-12-07 Thread Vlastimil Babka
On 12/07/2016 09:43 AM, Michal Hocko wrote: > On Tue 06-12-16 09:53:14, Xishi Qiu wrote: >> A compiler could re-read "old_flags" from the memory location after reading >> and calculation "flags" and passes a newer value into the cmpxchg making >> the comparison succeed while it should actually fai

Re: [RFC PATCH v3] mm: use READ_ONCE in page_cpupid_xchg_last()

2016-12-07 Thread Michal Hocko
On Tue 06-12-16 09:53:14, Xishi Qiu wrote: > A compiler could re-read "old_flags" from the memory location after reading > and calculation "flags" and passes a newer value into the cmpxchg making > the comparison succeed while it should actually fail. > > Signed-off-by: Xishi Qiu > Suggested-by:

Re: [RFC PATCH v3] mm: use READ_ONCE in page_cpupid_xchg_last()

2016-12-07 Thread Vlastimil Babka
On 12/06/2016 02:53 AM, Xishi Qiu wrote: > A compiler could re-read "old_flags" from the memory location after reading > and calculation "flags" and passes a newer value into the cmpxchg making > the comparison succeed while it should actually fail. > > Signed-off-by: Xishi Qiu > Suggested-by: C

[RFC PATCH v3] mm: use READ_ONCE in page_cpupid_xchg_last()

2016-12-05 Thread Xishi Qiu
A compiler could re-read "old_flags" from the memory location after reading and calculation "flags" and passes a newer value into the cmpxchg making the comparison succeed while it should actually fail. Signed-off-by: Xishi Qiu Suggested-by: Christian Borntraeger --- mm/mmzone.c | 2 +- 1 file