Skip to content

Commit 923717c

Browse files
KAGA-KOKOingomolnar
authored andcommitted
sched/rt, mm: Use CONFIG_PREEMPTION
CONFIG_PREEMPTION is selected by CONFIG_PREEMPT and by CONFIG_PREEMPT_RT. Both PREEMPT and PREEMPT_RT require the same functionality which today depends on CONFIG_PREEMPT. Switch the pte_unmap_same() and SLUB code over to use CONFIG_PREEMPTION. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Chistoph Lameter <cl@linux.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Pekka Enberg <penberg@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/20191015191821.11479-26-bigeasy@linutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 9454587 commit 923717c

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎mm/memory.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2151,7 +2151,7 @@ static inline int pte_unmap_same(struct mm_struct *mm, pmd_t *pmd,
21512151
pte_t *page_table, pte_t orig_pte)
21522152
{
21532153
int same = 1;
2154-
#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT)
2154+
#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPTION)
21552155
if (sizeof(pte_t) > sizeof(unsigned long)) {
21562156
spinlock_t *ptl = pte_lockptr(mm, pmd);
21572157
spin_lock(ptl);

‎mm/slub.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1964,7 +1964,7 @@ static void *get_partial(struct kmem_cache *s, gfp_t flags, int node,
19641964
return get_any_partial(s, flags, c);
19651965
}
19661966

1967-
#ifdef CONFIG_PREEMPT
1967+
#ifdef CONFIG_PREEMPTION
19681968
/*
19691969
* Calculate the next globally unique transaction for disambiguiation
19701970
* during cmpxchg. The transactions start with the cpu number and are then
@@ -2009,7 +2009,7 @@ static inline void note_cmpxchg_failure(const char *n,
20092009

20102010
pr_info("%s %s: cmpxchg redo ", n, s->name);
20112011

2012-
#ifdef CONFIG_PREEMPT
2012+
#ifdef CONFIG_PREEMPTION
20132013
if (tid_to_cpu(tid) != tid_to_cpu(actual_tid))
20142014
pr_warn("due to cpu change %d -> %d\n",
20152015
tid_to_cpu(tid), tid_to_cpu(actual_tid));
@@ -2637,7 +2637,7 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
26372637
unsigned long flags;
26382638

26392639
local_irq_save(flags);
2640-
#ifdef CONFIG_PREEMPT
2640+
#ifdef CONFIG_PREEMPTION
26412641
/*
26422642
* We may have been preempted and rescheduled on a different
26432643
* cpu before disabling interrupts. Need to reload cpu area
@@ -2691,13 +2691,13 @@ static __always_inline void *slab_alloc_node(struct kmem_cache *s,
26912691
* as we end up on the original cpu again when doing the cmpxchg.
26922692
*
26932693
* We should guarantee that tid and kmem_cache are retrieved on
2694-
* the same cpu. It could be different if CONFIG_PREEMPT so we need
2694+
* the same cpu. It could be different if CONFIG_PREEMPTION so we need
26952695
* to check if it is matched or not.
26962696
*/
26972697
do {
26982698
tid = this_cpu_read(s->cpu_slab->tid);
26992699
c = raw_cpu_ptr(s->cpu_slab);
2700-
} while (IS_ENABLED(CONFIG_PREEMPT) &&
2700+
} while (IS_ENABLED(CONFIG_PREEMPTION) &&
27012701
unlikely(tid != READ_ONCE(c->tid)));
27022702

27032703
/*
@@ -2971,7 +2971,7 @@ static __always_inline void do_slab_free(struct kmem_cache *s,
29712971
do {
29722972
tid = this_cpu_read(s->cpu_slab->tid);
29732973
c = raw_cpu_ptr(s->cpu_slab);
2974-
} while (IS_ENABLED(CONFIG_PREEMPT) &&
2974+
} while (IS_ENABLED(CONFIG_PREEMPTION) &&
29752975
unlikely(tid != READ_ONCE(c->tid)));
29762976

29772977
/* Same with comment on barrier() in slab_alloc_node() */

0 commit comments

Comments
 (0)