On Mon, 8 Apr 2019, Konstantin Khlebnikov wrote: > > I suppose your solution will wait for wakeup from shmem_evict_inode()? No, it's the other way round: shmem_unuse() gets on with its work without delay, shmem_evict_inode() waits until the stop_eviction count has gone down to zero, saying nobody else is at work on the inode. Waiting in shmem_evict_inode() might be more worrying, if it weren't already packed full with lock_page()s. And less attractive with the old quadratic style of swapoff, when shmem_evict_inode() would have freed the inode's swap much more efficiently than swapoff could then manage. Hugh