slab allocators: Remove SLAB_CTOR_ATOMIC
[firefly-linux-kernel-4.4.55.git] / mm / slub.c
index 3904002bdb35131be0ba80b4714ed6e8f5f8e6c7..347e44821bcb8b7e5b10a77a1c79c7debed1caa9 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -97,9 +97,6 @@
  *
  * - Support PAGE_ALLOC_DEBUG. Should be easy to do.
  *
- * - SLAB_DEBUG_INITIAL is not supported but I have never seen a use of
- *   it.
- *
  * - Variable sizing of the per node arrays
  */
 
 
 #endif
 
-/*
- * Flags from the regular SLAB that SLUB does not support:
- */
-#define SLUB_UNIMPLEMENTED (SLAB_DEBUG_INITIAL)
-
 /*
  * Mininum number of partial slabs. These will be left on the partial
  * lists even if they are empty. kmem_cache_shrink may reclaim them.
@@ -810,14 +802,8 @@ static void setup_object(struct kmem_cache *s, struct page *page,
                init_tracking(s, object);
        }
 
-       if (unlikely(s->ctor)) {
-               int mode = SLAB_CTOR_CONSTRUCTOR;
-
-               if (!(s->flags & __GFP_WAIT))
-                       mode |= SLAB_CTOR_ATOMIC;
-
-               s->ctor(object, s, mode);
-       }
+       if (unlikely(s->ctor))
+               s->ctor(object, s, SLAB_CTOR_CONSTRUCTOR);
 }
 
 static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node)
@@ -1496,7 +1482,7 @@ static unsigned long calculate_alignment(unsigned long flags,
         * specified alignment though. If that is greater
         * then use it.
         */
-       if ((flags & (SLAB_MUST_HWCACHE_ALIGN | SLAB_HWCACHE_ALIGN)) &&
+       if ((flags & SLAB_HWCACHE_ALIGN) &&
                        size > L1_CACHE_BYTES / 2)
                return max_t(unsigned long, align, L1_CACHE_BYTES);
 
@@ -1748,8 +1734,6 @@ static int kmem_cache_open(struct kmem_cache *s, gfp_t gfpflags,
        s->flags = flags;
        s->align = align;
 
-       BUG_ON(flags & SLUB_UNIMPLEMENTED);
-
        /*
         * The page->offset field is only 16 bit wide. This is an offset
         * in units of words from the beginning of an object. If the slab
@@ -3142,8 +3126,7 @@ SLAB_ATTR(reclaim_account);
 
 static ssize_t hwcache_align_show(struct kmem_cache *s, char *buf)
 {
-       return sprintf(buf, "%d\n", !!(s->flags &
-               (SLAB_HWCACHE_ALIGN|SLAB_MUST_HWCACHE_ALIGN)));
+       return sprintf(buf, "%d\n", !!(s->flags & SLAB_HWCACHE_ALIGN));
 }
 SLAB_ATTR_RO(hwcache_align);