Re: page migration: Fail with error if swap not setup

Andrew Morton
2006-03-15T03:52:34Z

Christoph Lameter <clameter@sgi.com> wrote:
>
> On Tue, 14 Mar 2006, Andrew Morton wrote:
>
> > Christoph Lameter <clameter@sgi.com> wrote:
> > >
> > > Currently the migration of anonymous pages will silently fail if no swap
> > > is setup.
> >
> > Why?
>
> The allocation of the swap page will fail in migrate_pages() and then the
> page is going on the permant failure list. Hmm... This is not a real
> total failure of page migration since file backed pages can be migrated
> without having swap and page migration will continue for those. However,
> all anonymous pages will end up on the failed list. At the end of page
> migration these will be returned to the LRU. Thus they stay where they
> were.
>
> > I mean, if something tries to allocate a swap page and that fails then the
> > error should be propagated back. That's race-free.
>
> It is propaged back in the form of a list of pages that failed to migrate.
> Its just no clear at the end what the reasons for the individual failures
> were. Its better just to check for swap availability before migration.

But the operation can still fail if we run out of swapspace partway through
- so this problem can still occur. The patch just makes it (much) less
frequent.

Surely it's possible to communicate -ENOSWAP correctly and reliably?