diff options
author | Christoph Lameter <clameter@sgi.com> | 2008-02-16 02:45:24 -0500 |
---|---|---|
committer | Christoph Lameter <clameter@sgi.com> | 2008-03-03 15:22:30 -0500 |
commit | e153362a50a34439718a938a851bba977116e19a (patch) | |
tree | c8c4b19d13435f9d94ba92eb0c1ab1d8ff25c31a /mm/slub.c | |
parent | d9acf4b7b62d783d84273a61aed41a0f025b08ac (diff) |
slub: Remove objsize check in kmem_cache_flags()
There is no page->offset anymore and also no associated limit on the number
of objects. The page->offset field was removed for 2.6.24. So the check
in kmem_cache_flags() is now also obsolete (should have been dropped
earlier, somehow a hunk vanished).
Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-by: Christoph Lameter <clameter@sgi.com>
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 27 |
1 files changed, 4 insertions, 23 deletions
@@ -997,30 +997,11 @@ static unsigned long kmem_cache_flags(unsigned long objsize, | |||
997 | void (*ctor)(struct kmem_cache *, void *)) | 997 | void (*ctor)(struct kmem_cache *, void *)) |
998 | { | 998 | { |
999 | /* | 999 | /* |
1000 | * The page->offset field is only 16 bit wide. This is an offset | 1000 | * Enable debugging if selected on the kernel commandline. |
1001 | * in units of words from the beginning of an object. If the slab | ||
1002 | * size is bigger then we cannot move the free pointer behind the | ||
1003 | * object anymore. | ||
1004 | * | ||
1005 | * On 32 bit platforms the limit is 256k. On 64bit platforms | ||
1006 | * the limit is 512k. | ||
1007 | * | ||
1008 | * Debugging or ctor may create a need to move the free | ||
1009 | * pointer. Fail if this happens. | ||
1010 | */ | 1001 | */ |
1011 | if (objsize >= 65535 * sizeof(void *)) { | 1002 | if (slub_debug && (!slub_debug_slabs || |
1012 | BUG_ON(flags & (SLAB_RED_ZONE | SLAB_POISON | | 1003 | strncmp(slub_debug_slabs, name, strlen(slub_debug_slabs)) == 0)) |
1013 | SLAB_STORE_USER | SLAB_DESTROY_BY_RCU)); | 1004 | flags |= slub_debug; |
1014 | BUG_ON(ctor); | ||
1015 | } else { | ||
1016 | /* | ||
1017 | * Enable debugging if selected on the kernel commandline. | ||
1018 | */ | ||
1019 | if (slub_debug && (!slub_debug_slabs || | ||
1020 | strncmp(slub_debug_slabs, name, | ||
1021 | strlen(slub_debug_slabs)) == 0)) | ||
1022 | flags |= slub_debug; | ||
1023 | } | ||
1024 | 1005 | ||
1025 | return flags; | 1006 | return flags; |
1026 | } | 1007 | } |