Re: [GIT PULL] SLAB changes for v3.1-rc0

From: Eric Dumazet
Date: Mon Jul 25 2011 - 02:55:59 EST


Le vendredi 22 juillet 2011 Ã 11:08 +0300, Pekka Enberg a Ãcrit :
> Hi Linus,
>
> Here's batch of slab/slub/slob changes accumulated over the past few months.
> The biggest changes are alignment unification from Christoph Lameter and SLUB
> debugging improvements from Ben Greear. Also notable is SLAB 'struct
> kmem_cache' shrinkage from Eric Dumazet that helps large SMP systems.
>
> Please note that the SLUB lockless slowpath patches will be sent in a separate
> pull request.
>
> Pekka

Hi Pekka

Could we also merge in 3.1 following "simple enough" patch ?

Thanks

[PATCH] 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: Eric Dumazet <eric.dumazet@xxxxxxxxx>
Acked-by: Christoph Lameter <cl@xxxxxxxxx>
CC: Pekka Enberg <penberg@xxxxxxxxxx>
---
mm/slab.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/slab.c b/mm/slab.c
index 1e523ed..b80282a 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3934,7 +3934,7 @@ fail:

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;



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/