Skip to content

foundations for reserve-based allocation

Peter Zijlstra linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 74 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10mm: gfp_to_alloc_flags()mm/internal.h mm/page_alloc.c+66 -420 replies
2/10mm: system wide ALLOC_NO_WATERMARKmm/page_alloc.c+15 -037 replies
3/10mm: tag reseve pagesinclude/linux/mm_types.h mm/page_alloc.c+4 -112 replies
4/10mm: slub: add knowledge of reserve pagesinclude/linux/slub_def.h mm/slub.c+70 -715 replies
5/10mm: allow mempool to fall back to memalloc reservesmm/mempool.c+11 -10 replies
6/10mm: kmem_estimate_pages()include/linux/slab.h mm/slub.c+93 -00 replies
7/10mm: allow PF_MEMALLOC from softirq contextinclude/linux/sched.h kernel/softirq.c mm/page_alloc.c+11 -30 replies
8/10mm: serialize access to min_free_kbytesmm/page_alloc.c+13 -30 replies
9/10mm: emergency poolinclude/linux/mmzone.h mm/page_alloc.c mm/vmstat.c+78 -130 replies
10/10mm: __GFP_MEMALLOCinclude/linux/gfp.h mm/page_alloc.c+5 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/10] foundations for reserve-based allocation

In the interrest of getting swap over network working and posting in smaller series, here is the first series.

This series lays the foundations needed to do reserve based allocation. Traditionally we have used mempools (and others like radix_tree_preload) to handle the problem.

However this does not fit the network stack. It is built around variable sized allocations using kmalloc().

This calls for a different approach.

We want a guarantee for N bytes from kmalloc(), this translates to a demand on the slab allocator for 2*N+m (due to the power-of-two nature of kmalloc slabs), where m is the meta-data needed by the allocator itself.

The slab allocator then puts a demand of P pages on the page allocator.

So we need functions translating our demanded kmalloc space into a page reserve limit, and then need to provide a reserve of pages.

And we need to ensure that once we hit the reserve, the slab allocator honours the reserve's access. That is, a regular allocation may not get objects from a slab allocated from the reserves.

There is already a page reserve, but it does not fully comply with our needs. For example, it does not guarantee a strict level (due to the relative nature of ALLOC_HIGH and ALLOC_HARDER). Hence we augment this reserve with a strict limit.

Furthermore a new __GFP flag is added to allow easy access to the reserves along-side the existing PF_MEMALLOC.

Users of this infrastructure will need to do the necessary bean counting to ensure they stay within the requested limits.

NOTE: I have currently only implemented SLUB support, I'm still hoping at least one of the others will die soon and save me the trouble.

--

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>