diff options
author | Christoph Lameter <clameter@sgi.com> | 2008-04-14 12:11:40 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@cs.helsinki.fi> | 2008-04-27 11:28:18 -0400 |
commit | 65c3376aaca96c66aa76014aaf430398964b68cb (patch) | |
tree | 9cd8d64a2cf211e76afbad0de5ec1484af6bfafb /include/linux | |
parent | 205ab99dd103e3dd5b0964dad8a16dfe2db69b2e (diff) |
slub: Fallback to minimal order during slab page allocation
If any higher order allocation fails then fall back the smallest order
necessary to contain at least one object. This enables fallback for all
allocations to order 0 pages. The fallback will waste more memory (objects
will not fit neatly) and the fallback slabs will be not as efficient as larger
slabs since they contain less objects.
Note that SLAB also depends on order 1 allocations for some slabs that waste
too much memory if forced into PAGE_SIZE'd page. SLUB now can now deal with
failing order 1 allocs which SLAB cannot do.
Add a new field min that will contain the objects for the smallest possible order
for a slab cache.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/slub_def.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index 4236b5dee812..71e43a12ebbb 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
@@ -29,6 +29,7 @@ enum stat_item { | |||
29 | DEACTIVATE_TO_HEAD, /* Cpu slab was moved to the head of partials */ | 29 | DEACTIVATE_TO_HEAD, /* Cpu slab was moved to the head of partials */ |
30 | DEACTIVATE_TO_TAIL, /* Cpu slab was moved to the tail of partials */ | 30 | DEACTIVATE_TO_TAIL, /* Cpu slab was moved to the tail of partials */ |
31 | DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */ | 31 | DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */ |
32 | ORDER_FALLBACK, /* Number of times fallback was necessary */ | ||
32 | NR_SLUB_STAT_ITEMS }; | 33 | NR_SLUB_STAT_ITEMS }; |
33 | 34 | ||
34 | struct kmem_cache_cpu { | 35 | struct kmem_cache_cpu { |
@@ -81,6 +82,7 @@ struct kmem_cache { | |||
81 | 82 | ||
82 | /* Allocation and freeing of slabs */ | 83 | /* Allocation and freeing of slabs */ |
83 | struct kmem_cache_order_objects max; | 84 | struct kmem_cache_order_objects max; |
85 | struct kmem_cache_order_objects min; | ||
84 | gfp_t allocflags; /* gfp flags to use on each alloc */ | 86 | gfp_t allocflags; /* gfp flags to use on each alloc */ |
85 | int refcount; /* Refcount for slab cache destroy */ | 87 | int refcount; /* Refcount for slab cache destroy */ |
86 | void (*ctor)(struct kmem_cache *, void *); | 88 | void (*ctor)(struct kmem_cache *, void *); |