Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit acfe7d74 authored by Eric Dumazet's avatar Eric Dumazet Committed by Pekka Enberg
Browse files

slab: remove one NR_CPUS dependency



Reduce high order allocations in do_tune_cpucache() for some setups.
(NR_CPUS=4096 -> we need 64KB)

Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Acked-by: default avatarChristoph Lameter <cl@linux.com>
Signed-off-by: default avatarPekka Enberg <penberg@kernel.org>
parent 95b68865
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -3934,7 +3934,7 @@ static int alloc_kmemlist(struct kmem_cache *cachep, gfp_t gfp)

struct ccupdate_struct {
	struct kmem_cache *cachep;
	struct array_cache *new[NR_CPUS];
	struct array_cache *new[0];
};

static void do_ccupdate_local(void *info)
@@ -3956,7 +3956,8 @@ static int do_tune_cpucache(struct kmem_cache *cachep, int limit,
	struct ccupdate_struct *new;
	int i;

	new = kzalloc(sizeof(*new), gfp);
	new = kzalloc(sizeof(*new) + nr_cpu_ids * sizeof(struct array_cache *),
		      gfp);
	if (!new)
		return -ENOMEM;