diff options
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -2220,8 +2220,8 @@ kmem_cache_create (const char *name, size_t size, size_t align, | |||
2220 | if (ralign < align) { | 2220 | if (ralign < align) { |
2221 | ralign = align; | 2221 | ralign = align; |
2222 | } | 2222 | } |
2223 | /* disable debug if necessary */ | 2223 | /* disable debug if not aligning with REDZONE_ALIGN */ |
2224 | if (ralign > __alignof__(unsigned long long)) | 2224 | if (ralign & (__alignof__(unsigned long long) - 1)) |
2225 | flags &= ~(SLAB_RED_ZONE | SLAB_STORE_USER); | 2225 | flags &= ~(SLAB_RED_ZONE | SLAB_STORE_USER); |
2226 | /* | 2226 | /* |
2227 | * 4) Store it. | 2227 | * 4) Store it. |
@@ -2247,8 +2247,8 @@ kmem_cache_create (const char *name, size_t size, size_t align, | |||
2247 | */ | 2247 | */ |
2248 | if (flags & SLAB_RED_ZONE) { | 2248 | if (flags & SLAB_RED_ZONE) { |
2249 | /* add space for red zone words */ | 2249 | /* add space for red zone words */ |
2250 | cachep->obj_offset += sizeof(unsigned long long); | 2250 | cachep->obj_offset += align; |
2251 | size += 2 * sizeof(unsigned long long); | 2251 | size += align + sizeof(unsigned long long); |
2252 | } | 2252 | } |
2253 | if (flags & SLAB_STORE_USER) { | 2253 | if (flags & SLAB_STORE_USER) { |
2254 | /* user store requires one word storage behind the end of | 2254 | /* user store requires one word storage behind the end of |