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

From: Mel Gorman
Date: Thu Jan 04 2018 - 05:21:20 EST


On Thu, Jan 04, 2018 at 09:17:36AM +0800, Huang, Ying wrote:
> > Maybe, but in this particular case, I would prefer to go with something
> > more conventional unless there is strong evidence that it's an improvement
> > (which I doubt in this case given the cost of migration overall and the
> > corner case of migrating a dirty page).
>
> So you like page_lock() more than RCU?

In this instance, yes.

> Is there any problem of RCU?
> The object to be protected isn't clear?
>

It's not clear what object is being protected or how it's protected and
it's not the usual means a mapping is pinned. Furthermore, in the event
a page is being truncated, we really do not want to bother doing any
migration work for compaction purposes as it's a waste.

--
Mel Gorman
SUSE Labs