Re: [RFC 1/2] page-flags: Make page lock operation atomic

2019-02-12 Thread Peter Zijlstra
On Tue, Feb 12, 2019 at 08:45:35AM +0100, Jan Kara wrote: > On Mon 11-02-19 09:56:53, Matthew Wilcox wrote: > > On Mon, Feb 11, 2019 at 06:48:46PM +0100, Jan Kara wrote: > > > On Mon 11-02-19 13:59:24, Linux Upstream wrote: > > > > > > > > > >> Signed-off-by: Chintan Pandya > > > > > > > > > >

Re: [RFC 1/2] page-flags: Make page lock operation atomic

2019-02-11 Thread Jan Kara
On Mon 11-02-19 09:56:53, Matthew Wilcox wrote: > On Mon, Feb 11, 2019 at 06:48:46PM +0100, Jan Kara wrote: > > On Mon 11-02-19 13:59:24, Linux Upstream wrote: > > > > > > > >> Signed-off-by: Chintan Pandya > > > > > > > > NAK. > > > > > > > > This is bound to regress some stuff. Now agreed

Re: [RFC 1/2] page-flags: Make page lock operation atomic

2019-02-11 Thread Matthew Wilcox
On Mon, Feb 11, 2019 at 06:48:46PM +0100, Jan Kara wrote: > On Mon 11-02-19 13:59:24, Linux Upstream wrote: > > > > > >> Signed-off-by: Chintan Pandya > > > > > > NAK. > > > > > > This is bound to regress some stuff. Now agreed that using non-atomic > > > ops is tricky, but many are in places

Re: [RFC 1/2] page-flags: Make page lock operation atomic

2019-02-11 Thread Jan Kara
On Mon 11-02-19 13:59:24, Linux Upstream wrote: > > > >> Signed-off-by: Chintan Pandya > > > > NAK. > > > > This is bound to regress some stuff. Now agreed that using non-atomic > > ops is tricky, but many are in places where we 'know' there can't be > > concurrency. > > > > If you can show

Re: [RFC 1/2] page-flags: Make page lock operation atomic

2019-02-11 Thread Linux Upstream
On 11/02/19 7:16 PM, Peter Zijlstra wrote: > On Mon, Feb 11, 2019 at 12:53:53PM +, Chintan Pandya wrote: >> Currently, page lock operation is non-atomic. This is opening >> some scope for race condition. For ex, if 2 threads are accessing >> same page flags, it may happen that our desired

Re: [RFC 1/2] page-flags: Make page lock operation atomic

2019-02-11 Thread Peter Zijlstra
On Mon, Feb 11, 2019 at 12:53:53PM +, Chintan Pandya wrote: > Currently, page lock operation is non-atomic. This is opening > some scope for race condition. For ex, if 2 threads are accessing > same page flags, it may happen that our desired thread's page > lock bit (PG_locked) might get