Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

slab: remove unused PREEMPT_RT specific macros

The macros slub_get_cpu_ptr()/slub_put_cpu_ptr() are now unused, remove
them. USE_LOCKLESS_FAST_PATH() has lost its true meaning with the code
being removed. The only remaining usage is in fact testing whether we
can assert irqs disabled, because spin_lock_irqsave() only does that on
!RT. Test for CONFIG_PREEMPT_RT instead.

Reviewed-by: Hao Li <hao.li@linux.dev>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Harry Yoo <harry.yoo@oracle.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>

+1 -23
+1 -23
mm/slub.c
··· 201 201 SL_pfmemalloc = PG_active, /* Historical reasons for this bit */ 202 202 }; 203 203 204 - /* 205 - * We could simply use migrate_disable()/enable() but as long as it's a 206 - * function call even on !PREEMPT_RT, use inline preempt_disable() there. 207 - */ 208 - #ifndef CONFIG_PREEMPT_RT 209 - #define slub_get_cpu_ptr(var) get_cpu_ptr(var) 210 - #define slub_put_cpu_ptr(var) put_cpu_ptr(var) 211 - #define USE_LOCKLESS_FAST_PATH() (true) 212 - #else 213 - #define slub_get_cpu_ptr(var) \ 214 - ({ \ 215 - migrate_disable(); \ 216 - this_cpu_ptr(var); \ 217 - }) 218 - #define slub_put_cpu_ptr(var) \ 219 - do { \ 220 - (void)(var); \ 221 - migrate_enable(); \ 222 - } while (0) 223 - #define USE_LOCKLESS_FAST_PATH() (false) 224 - #endif 225 - 226 204 #ifndef CONFIG_SLUB_TINY 227 205 #define __fastpath_inline __always_inline 228 206 #else ··· 691 713 { 692 714 bool ret; 693 715 694 - if (USE_LOCKLESS_FAST_PATH()) 716 + if (!IS_ENABLED(CONFIG_PREEMPT_RT)) 695 717 lockdep_assert_irqs_disabled(); 696 718 697 719 if (s->flags & __CMPXCHG_DOUBLE)