Re: [PATCH -V3 -mm] mm, swap: Fix race between swapoff and some swap operations

From: Junaid Shahid
Date: Mon Dec 18 2017 - 16:13:30 EST

On Monday, December 18, 2017 3:41:41 PM PST Huang, Ying wrote:
> A version implemented via stop_machine() could be gotten via a small
> patch as below. If you still prefer stop_machine(), I can resend a
> version implemented with stop_machine().

For the stop_machine() version, would it work to just put preempt_disable/enable at the start and end of lock_cluster() rather than introducing get/put_swap_device? Something like that might be simpler and would also disable preemption for less duration.