Skip to content

Commit 0a3f1e0

Browse files
shakeelbaxboe
authored andcommitted
mm: io_uring: allow oom-killer from io_uring_setup
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 0d7c115 commit 0a3f1e0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fs/io_uring.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8932,10 +8932,9 @@ static void io_mem_free(void *ptr)
89328932

89338933
static void *io_mem_alloc(size_t size)
89348934
{
8935-
gfp_t gfp_flags = GFP_KERNEL | __GFP_ZERO | __GFP_NOWARN | __GFP_COMP |
8936-
__GFP_NORETRY | __GFP_ACCOUNT;
8935+
gfp_t gfp = GFP_KERNEL_ACCOUNT | __GFP_ZERO | __GFP_NOWARN | __GFP_COMP;
89378936

8938-
return (void *) __get_free_pages(gfp_flags, get_order(size));
8937+
return (void *) __get_free_pages(gfp, get_order(size));
89398938
}
89408939

89418940
static unsigned long rings_size(unsigned sq_entries, unsigned cq_entries,

0 commit comments

Comments
 (0)