Patch "mm: io_uring: allow oom-killer from io_uring_setup" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    mm: io_uring: allow oom-killer from io_uring_setup

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mm-io_uring-allow-oom-killer-from-io_uring_setup.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 11c1c155d3ea13ad53e4437c65805737dccbf065
Author: Shakeel Butt <shakeelb@xxxxxxxxxx>
Date:   Mon Jan 24 21:17:36 2022 -0800

    mm: io_uring: allow oom-killer from io_uring_setup
    
    [ Upstream commit 0a3f1e0beacf6cc8ae5f846b0641c1df476e83d6 ]
    
    On an overcommitted system which is running multiple workloads of
    varying priorities, it is preferred to trigger an oom-killer to kill a
    low priority workload than to let the high priority workload receiving
    ENOMEMs. On our memory overcommitted systems, we are seeing a lot of
    ENOMEMs instead of oom-kills because io_uring_setup callchain is using
    __GFP_NORETRY gfp flag which avoids the oom-killer. Let's remove it and
    allow the oom-killer to kill a lower priority job.
    
    Signed-off-by: Shakeel Butt <shakeelb@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220125051736.2981459-1-shakeelb@xxxxxxxxxx
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 993913c585fbf..21fc8ce9405d3 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -8820,10 +8820,9 @@ static void io_mem_free(void *ptr)
 
 static void *io_mem_alloc(size_t size)
 {
-	gfp_t gfp_flags = GFP_KERNEL | __GFP_ZERO | __GFP_NOWARN | __GFP_COMP |
-				__GFP_NORETRY | __GFP_ACCOUNT;
+	gfp_t gfp = GFP_KERNEL_ACCOUNT | __GFP_ZERO | __GFP_NOWARN | __GFP_COMP;
 
-	return (void *) __get_free_pages(gfp_flags, get_order(size));
+	return (void *) __get_free_pages(gfp, get_order(size));
 }
 
 static unsigned long rings_size(unsigned sq_entries, unsigned cq_entries,



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux