Re: [PATCH] stop swapoff 3/3 OOMkill

Andrew Morton (akpm@digeo.com)
Thu, 17 Apr 2003 14:55:27 -0700


Hugh Dickins <hugh@veritas.com> wrote:
>
> Current behaviour is that once swapoff has filled memory, other tasks
> get OOMkilled one by one until it completes, or more likely hangs.
> Better that swapoff be the first choice for OOMkill.

This calls for __GFP_NORETRY. It will disable the oom-kill and the infinite
retry in the page allocator. So we will have:

__GFP_REPEAT:

retry the allocation, but the caller can handle a failure.
eg: pte_alloc_one().

__GFP_REPEAT _may_ end up returning NULL. It depends on the VM
implemention - eg it would in -aa kernels.

__GFP_NOFAIL:

retry the allocation inifinitely, regardless of the VM implementation.
For jbd_kmalloc() and others.

__GFP_NORETRY:

Don't oom-kill and don't retry. For swapoff.

I've implemented a __GFP_REPEAT, and don't like it, because it blurs the
__GFP_REPEAT and __GFP_NOFAIL requirements. I'll add __GFP_NORETRY and we
can then pass that into read_swap_cache_async() and handle the error.

Sound good?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/