diff options
-rw-r--r-- | mm/slub.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -2130,6 +2130,14 @@ static int calculate_sizes(struct kmem_cache *s) | |||
2130 | unsigned long align = s->align; | 2130 | unsigned long align = s->align; |
2131 | 2131 | ||
2132 | /* | 2132 | /* |
2133 | * Round up object size to the next word boundary. We can only | ||
2134 | * place the free pointer at word boundaries and this determines | ||
2135 | * the possible location of the free pointer. | ||
2136 | */ | ||
2137 | size = ALIGN(size, sizeof(void *)); | ||
2138 | |||
2139 | #ifdef CONFIG_SLUB_DEBUG | ||
2140 | /* | ||
2133 | * Determine if we can poison the object itself. If the user of | 2141 | * Determine if we can poison the object itself. If the user of |
2134 | * the slab may touch the object after free or before allocation | 2142 | * the slab may touch the object after free or before allocation |
2135 | * then we should never poison the object itself. | 2143 | * then we should never poison the object itself. |
@@ -2140,14 +2148,7 @@ static int calculate_sizes(struct kmem_cache *s) | |||
2140 | else | 2148 | else |
2141 | s->flags &= ~__OBJECT_POISON; | 2149 | s->flags &= ~__OBJECT_POISON; |
2142 | 2150 | ||
2143 | /* | ||
2144 | * Round up object size to the next word boundary. We can only | ||
2145 | * place the free pointer at word boundaries and this determines | ||
2146 | * the possible location of the free pointer. | ||
2147 | */ | ||
2148 | size = ALIGN(size, sizeof(void *)); | ||
2149 | 2151 | ||
2150 | #ifdef CONFIG_SLUB_DEBUG | ||
2151 | /* | 2152 | /* |
2152 | * If we are Redzoning then check if there is some space between the | 2153 | * If we are Redzoning then check if there is some space between the |
2153 | * end of the object and the free pointer. If not then add an | 2154 | * end of the object and the free pointer. If not then add an |