summaryrefslogtreecommitdiff
path: root/kernel/taskstats.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-05-06 21:49:57 (GMT)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 19:12:55 (GMT)
commit0a31bd5f2bbb6473ef9d24f0063ca91cfa678b64 (patch)
treea945e829bf6bf7a93bf844b2ee9f2a3a2fa17c5d /kernel/taskstats.c
parent5af60839909b8e3b28ca7cd7912fa0b23475617f (diff)
downloadlinux-fsl-qoriq-0a31bd5f2bbb6473ef9d24f0063ca91cfa678b64.tar.xz
KMEM_CACHE(): simplify slab cache creation
This patch provides a new macro KMEM_CACHE(<struct>, <flags>) to simplify slab creation. KMEM_CACHE creates a slab with the name of the struct, with the size of the struct and with the alignment of the struct. Additional slab flags may be specified if necessary. Example struct test_slab { int a,b,c; struct list_head; } __cacheline_aligned_in_smp; test_slab_cache = KMEM_CACHE(test_slab, SLAB_PANIC) will create a new slab named "test_slab" of the size sizeof(struct test_slab) and aligned to the alignment of test slab. If it fails then we panic. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/taskstats.c')
-rw-r--r--kernel/taskstats.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/taskstats.c b/kernel/taskstats.c
index ad7d239..906cae7 100644
--- a/kernel/taskstats.c
+++ b/kernel/taskstats.c
@@ -524,9 +524,7 @@ void __init taskstats_init_early(void)
{
unsigned int i;
- taskstats_cache = kmem_cache_create("taskstats_cache",
- sizeof(struct taskstats),
- 0, SLAB_PANIC, NULL, NULL);
+ taskstats_cache = KMEM_CACHE(taskstats, SLAB_PANIC);
for_each_possible_cpu(i) {
INIT_LIST_HEAD(&(per_cpu(listener_array, i).list));
init_rwsem(&(per_cpu(listener_array, i).sem));