Skip to content
  • Vlastimil Babka's avatar
    mm, slub: use migrate_disable() on PREEMPT_RT · 27d610b4
    Vlastimil Babka authored
    
    
    We currently use preempt_disable() (directly or via get_cpu_ptr()) to stabilize
    the pointer to kmem_cache_cpu. On PREEMPT_RT this would be incompatible with
    the list_lock spinlock. We can use migrate_disable() instead, but that
    increases overhead on !PREEMPT_RT as it's an unconditional function call.
    
    In order to get the best available mechanism on both PREEMPT_RT and
    !PREEMPT_RT, introduce private slub_get_cpu_ptr() and slub_put_cpu_ptr()
    wrappers and use them.
    
    Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
    Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
    27d610b4