Re: [PATCH 4/8] mm/swap: Use local_lock for protection

2020-05-20 Thread Peter Zijlstra
On Tue, May 19, 2020 at 10:19:08PM +0200, Sebastian Andrzej Siewior wrote: > diff --git a/mm/swap.c b/mm/swap.c > index bf9a79fed62d7..03c97d15fcd69 100644 > --- a/mm/swap.c > +++ b/mm/swap.c > @@ -44,8 +44,14 @@ > /* How many pages do we try to swap or page in/out together? */ > int

Re: [PATCH 4/8] mm/swap: Use local_lock for protection

2020-05-19 Thread Matthew Wilcox
On Tue, May 19, 2020 at 04:58:37PM -0700, Andrew Morton wrote: > On Tue, 19 May 2020 22:19:08 +0200 Sebastian Andrzej Siewior > wrote: > > + local_lock(swapvec_lock); > > It's quite peculiar that these operations appear to be pass-by-value. > All other locking

Re: [PATCH 4/8] mm/swap: Use local_lock for protection

2020-05-19 Thread Andrew Morton
On Tue, 19 May 2020 22:19:08 +0200 Sebastian Andrzej Siewior wrote: > From: Ingo Molnar > > The various struct pagevec per CPU variables are protected by disabling > either preemption or interrupts across the critical sections. Inside > these sections spinlocks have to be acquired. > > These

[PATCH 4/8] mm/swap: Use local_lock for protection

2020-05-19 Thread Sebastian Andrzej Siewior
From: Ingo Molnar The various struct pagevec per CPU variables are protected by disabling either preemption or interrupts across the critical sections. Inside these sections spinlocks have to be acquired. These spinlocks are regular spinlock_t types which are converted to "sleeping" spinlocks