Re: [PATCH] stop swapoff 3/3 OOMkill

From: Andrew Morton (
Date: Thu Apr 17 2003 - 16:55:27 EST

Hugh Dickins <> 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:


        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.


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


        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
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed Apr 23 2003 - 22:00:22 EST