Re: [PATCH] mm: swap: do not wait for lock_page() in unuse_pte_range()

2020-07-22 Thread Andrea Righi
On Wed, Jul 22, 2020 at 07:04:25PM +0100, Matthew Wilcox wrote: > On Wed, Jul 22, 2020 at 07:44:36PM +0200, Andrea Righi wrote: > > Waiting for lock_page() with mm->mmap_sem held in unuse_pte_range() can > > lead to stalls while running swapoff (i.e., not being able to ssh into > > the system, inab

Re: [PATCH] mm: swap: do not wait for lock_page() in unuse_pte_range()

2020-07-22 Thread Matthew Wilcox
On Wed, Jul 22, 2020 at 07:44:36PM +0200, Andrea Righi wrote: > Waiting for lock_page() with mm->mmap_sem held in unuse_pte_range() can > lead to stalls while running swapoff (i.e., not being able to ssh into > the system, inability to execute simple commands like 'ps', etc.). > > Replace lock_pag

[PATCH] mm: swap: do not wait for lock_page() in unuse_pte_range()

2020-07-22 Thread Andrea Righi
Waiting for lock_page() with mm->mmap_sem held in unuse_pte_range() can lead to stalls while running swapoff (i.e., not being able to ssh into the system, inability to execute simple commands like 'ps', etc.). Replace lock_page() with trylock_page() and release mm->mmap_sem if we fail to lock it,