summaryrefslogtreecommitdiff
path: root/include/linux/timerqueue.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2026-11-03 17:16:48 +0100
committerVlastimil Babka (SUSE) <vbabka@kernel.org>2026-11-05 10:58:52 +0100
commitc028ecdf15131a2ab70d78a76657b81c00fa240d (patch)
treec874ee5aa20c71d4d542d5171745e91cc2f45c76 /include/linux/timerqueue.h
parentaae6b83fe47ed8bff9195efbe1d191ec52e5436e (diff)
mm: page_frag: refill the cache for large fragments
A fragment which is larger than PAGE_SIZE can only be served from the 32K page of a page_frag_cache. If memory is low and the cache had to fall back to a single page, __page_frag_alloc_align() returns NULL and keeps that page. Since the offset counts up, this check comes first and is made whenever the fragment does not fit behind nc->offset, no matter how big the page of the cache is. So the cache is never refilled on behalf of a large fragment: with fragsz = 10000 the first three allocations succeed, the fourth one and all the following ones fail although memory is plentiful. nc->offset does not move either, so this lasts until smaller fragments have used up the rest of the page, which never happens if the cache has no other user. The nfp driver allocates its receive buffers with napi_alloc_frag() and netdev_alloc_frag(). They are larger than a page with a jumbo MTU. Only give up if the fragment does not fit into the page at all, which is what the comment describes. The fourth allocation in the scenario above with a 32k page will thus now proceed to refill the cache. Fixes: 8218f62c9c9b ("mm: page_frag: use initial zero offset for page_frag_alloc_align()") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Hildenbrand (Arm) <david@kernel.org> Reviewed-by: Johannes Weiner <hannes@cmpxchg.org> [vbabka@kernel.org: make the comment more obvious] Link: https://patch.msgid.link/20261103-pgalloc-ai-hotfixes-v2-2-e0d2890ab74f@kernel.org Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions