Skip to content

Commit 6c2f307

Browse files
committed
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 parent 32c894c commit 6c2f307

1 file changed

Lines changed: 1 addition & 23 deletions

File tree

mm/slub.c

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -201,28 +201,6 @@ enum slab_flags {
201201
SL_pfmemalloc = PG_active, /* Historical reasons for this bit */
202202
};
203203

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-
226204
#ifndef CONFIG_SLUB_TINY
227205
#define __fastpath_inline __always_inline
228206
#else
@@ -713,7 +691,7 @@ static inline bool __slab_update_freelist(struct kmem_cache *s, struct slab *sla
713691
{
714692
bool ret;
715693

716-
if (USE_LOCKLESS_FAST_PATH())
694+
if (!IS_ENABLED(CONFIG_PREEMPT_RT))
717695
lockdep_assert_irqs_disabled();
718696

719697
if (s->flags & __CMPXCHG_DOUBLE)

0 commit comments

Comments
 (0)