summaryrefslogtreecommitdiff
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorDavid Wei <dw@davidwei.uk>2026-10-01 11:17:52 -0700
committerJens Axboe <axboe@kernel.dk>2026-10-02 08:57:05 -0600
commit68477e4c562e3ec1333f64e010d75b3a257e7997 (patch)
tree84111e0fb71e8f78401ae206589f0d86889b3766 /include/uapi/linux
parent13d3783a55b758a9fa05b67835afa7e216476c61 (diff)
downloadlinux-next-68477e4c562e3ec1333f64e010d75b3a257e7997.tar.gz
linux-next-68477e4c562e3ec1333f64e010d75b3a257e7997.zip
io_uring/memmap: fix non-compound alloc fallback with memcg accounting
io_region_allocate_pages() first tries io_mem_alloc_compound(). If that fails, it uses alloc_pages_bulk_node() to allocate separate pages. The bulk allocator does not support memcg accounting. __GFP_ACCOUNT is unconditionally supplied, so when memcg_kmem_online() is true, it only allocates one page. For a multi-page request, io_uring treats this short result as failure and returns ENOMEM, even when the memcg has enough space for all pages. When this happens, fill the rest of the request with order 0 allocations via alloc_page(), which support memcg accounting. This maintains the existing fast path, while fixing the incorrect ENOMEM return when memcg is used. Signed-off-by: David Wei <dw@davidwei.uk> Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de> Fixes: 1e21df691ffa ("io_uring/memmap: implement kernel allocated regions") Link: https://patch.msgid.link/20261001181752.537767-1-dw@davidwei.uk Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/uapi/linux')
0 files changed, 0 insertions, 0 deletions