From: Alexei Starovoitov Add a struct kmem_cache *s parameter to alloc_slab_page() and update the two call sites in allocate_slab(). No functional change. This is a preparatory step for the upcoming SLAB_BPF_ARENA support, where alloc_slab_page() needs to consult cache-specific state to route arena caches through bpf_arena_alloc_slab_page() instead of the page allocator. Signed-off-by: Alexei Starovoitov --- mm/slub.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index c3899cc1dd1d..82862d57c0cd 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3261,7 +3261,8 @@ static void barn_shrink(struct kmem_cache *s, struct node_barn *barn) /* * Slab allocation and freeing */ -static inline struct slab *alloc_slab_page(gfp_t flags, int node, +static inline struct slab *alloc_slab_page(struct kmem_cache *s, gfp_t flags, + int node, struct kmem_cache_order_objects oo, bool allow_spin) { @@ -3464,7 +3465,7 @@ static struct slab *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) * __GFP_RECLAIM could be cleared on the first allocation attempt, * so pass allow_spin flag directly. */ - slab = alloc_slab_page(alloc_gfp, node, oo, allow_spin); + slab = alloc_slab_page(s, alloc_gfp, node, oo, allow_spin); if (unlikely(!slab)) { oo = s->min; alloc_gfp = flags; @@ -3472,7 +3473,7 @@ static struct slab *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) * Allocation may have failed due to fragmentation. * Try a lower order alloc if possible */ - slab = alloc_slab_page(alloc_gfp, node, oo, allow_spin); + slab = alloc_slab_page(s, alloc_gfp, node, oo, allow_spin); if (unlikely(!slab)) return NULL; stat(s, ORDER_FALLBACK); -- 2.53.0-Meta