diff options
Diffstat (limited to 'include/linux/slab.h')
| -rw-r--r-- | include/linux/slab.h | 22 | 
1 files changed, 18 insertions, 4 deletions
| diff --git a/include/linux/slab.h b/include/linux/slab.h index ca53425e9b32..791f7453a04f 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -54,16 +54,18 @@   * stays valid, the trick to using this is relying on an independent   * object validation pass. Something like:   * - *  rcu_read_lock() - * again: + * begin: + *  rcu_read_lock();   *  obj = lockless_lookup(key);   *  if (obj) {   *    if (!try_get_ref(obj)) // might fail for free objects - *      goto again; + *      rcu_read_unlock(); + *      goto begin;   *   *    if (obj->key != key) { // not the object we expected   *      put_ref(obj); - *      goto again; + *      rcu_read_unlock(); + *      goto begin;   *    }   *  }   *  rcu_read_unlock(); @@ -107,6 +109,18 @@  /* Avoid kmemleak tracing */  #define SLAB_NOLEAKTRACE	((slab_flags_t __force)0x00800000U) +/* + * Prevent merging with compatible kmem caches. This flag should be used + * cautiously. Valid use cases: + * + * - caches created for self-tests (e.g. kunit) + * - general caches created and used by a subsystem, only when a + *   (subsystem-specific) debug option is enabled + * - performance critical caches, should be very rare and consulted with slab + *   maintainers, and not used together with CONFIG_SLUB_TINY + */ +#define SLAB_NO_MERGE		((slab_flags_t __force)0x01000000U) +  /* Fault injection mark */  #ifdef CONFIG_FAILSLAB  # define SLAB_FAILSLAB		((slab_flags_t __force)0x02000000U) |