aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/slub.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 9cde663bbb10..c2a227d8a4ee 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -164,6 +164,14 @@ static inline bool kmem_cache_has_cpu_partial(struct kmem_cache *s)
164 SLAB_POISON | SLAB_STORE_USER) 164 SLAB_POISON | SLAB_STORE_USER)
165 165
166/* 166/*
167 * These debug flags cannot use CMPXCHG because there might be consistency
168 * issues when checking or reading debug information
169 */
170#define SLAB_NO_CMPXCHG (SLAB_CONSISTENCY_CHECKS | SLAB_STORE_USER | \
171 SLAB_TRACE)
172
173
174/*
167 * Debugging flags that require metadata to be stored in the slab. These get 175 * Debugging flags that require metadata to be stored in the slab. These get
168 * disabled when slub_debug=O is used and a cache's min order increases with 176 * disabled when slub_debug=O is used and a cache's min order increases with
169 * metadata. 177 * metadata.
@@ -3338,7 +3346,7 @@ static int kmem_cache_open(struct kmem_cache *s, unsigned long flags)
3338 3346
3339#if defined(CONFIG_HAVE_CMPXCHG_DOUBLE) && \ 3347#if defined(CONFIG_HAVE_CMPXCHG_DOUBLE) && \
3340 defined(CONFIG_HAVE_ALIGNED_STRUCT_PAGE) 3348 defined(CONFIG_HAVE_ALIGNED_STRUCT_PAGE)
3341 if (system_has_cmpxchg_double() && (s->flags & SLAB_DEBUG_FLAGS) == 0) 3349 if (system_has_cmpxchg_double() && (s->flags & SLAB_NO_CMPXCHG) == 0)
3342 /* Enable fast mode */ 3350 /* Enable fast mode */
3343 s->flags |= __CMPXCHG_DOUBLE; 3351 s->flags |= __CMPXCHG_DOUBLE;
3344#endif 3352#endif
@@ -4846,7 +4854,6 @@ static ssize_t red_zone_store(struct kmem_cache *s,
4846 4854
4847 s->flags &= ~SLAB_RED_ZONE; 4855 s->flags &= ~SLAB_RED_ZONE;
4848 if (buf[0] == '1') { 4856 if (buf[0] == '1') {
4849 s->flags &= ~__CMPXCHG_DOUBLE;
4850 s->flags |= SLAB_RED_ZONE; 4857 s->flags |= SLAB_RED_ZONE;
4851 } 4858 }
4852 calculate_sizes(s, -1); 4859 calculate_sizes(s, -1);
@@ -4867,7 +4874,6 @@ static ssize_t poison_store(struct kmem_cache *s,
4867 4874
4868 s->flags &= ~SLAB_POISON; 4875 s->flags &= ~SLAB_POISON;
4869 if (buf[0] == '1') { 4876 if (buf[0] == '1') {
4870 s->flags &= ~__CMPXCHG_DOUBLE;
4871 s->flags |= SLAB_POISON; 4877 s->flags |= SLAB_POISON;
4872 } 4878 }
4873 calculate_sizes(s, -1); 4879 calculate_sizes(s, -1);