Re: [PATCH v3 2/2] mm: rid swapoff of quadratic complexity

From: Vineeth Pillai
Date: Wed Jan 02 2019 - 15:05:37 EST


On Wed, Jan 2, 2019 at 2:43 PM Hugh Dickins <hughd@xxxxxxxxxx> wrote:

>
> Wrong. Without heavier locking that would add unwelcome overhead to
> common paths, we shall "always" need the retry logic. It does not
> come into play very often, but here are two examples of why it's
> needed (if I thought longer, I might find more). And in practice,
> yes, I sometimes saw 1 retry needed.
>
Understood. Sorry, I missed these corner cases.

> I don't use frontswap myself, and haven't paid any attention to the
> frontswap partial swapoff case (though notice now that shmem_unuse()
> lacks the plumbing needed for it - that needs fixing); but doubt it
> would be a good idea to refactor it out as a separate case.
>
I shall rework the shmem side to take care of the frontswap and retain
the retry logic in a simplified manner.

Thanks again for all the comments and insights..

~Vineeth