* [PATCH 25/34] mm: Use CONFIG_PREEMPTION [not found] <20191015191821.11479-1-bigeasy@linutronix.de> @ 2019-10-15 19:18 ` Sebastian Andrzej Siewior 2019-10-16 14:38 ` Christopher Lameter 2019-12-08 14:58 ` [tip: sched/urgent] sched/rt, " tip-bot2 for Thomas Gleixner 0 siblings, 2 replies; 3+ messages in thread From: Sebastian Andrzej Siewior @ 2019-10-15 19:18 UTC (permalink / raw) To: linux-kernel Cc: tglx, Christoph Lameter, Pekka Enberg, David Rientjes, Joonsoo Kim, Andrew Morton, linux-mm, Sebastian Andrzej Siewior From: Thomas Gleixner <tglx@linutronix.de> 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. Cc: Christoph Lameter <cl@linux.com> Cc: Pekka Enberg <penberg@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: linux-mm@kvack.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- mm/memory.c | 2 +- mm/slub.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index b1ca51a079f27..fd2cede4a84f0 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2133,7 +2133,7 @@ static inline int pte_unmap_same(struct mm_struct *mm, pmd_t *pmd, pte_t *page_table, pte_t orig_pte) { int same = 1; -#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT) +#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPTION) if (sizeof(pte_t) > sizeof(unsigned long)) { spinlock_t *ptl = pte_lockptr(mm, pmd); spin_lock(ptl); diff --git a/mm/slub.c b/mm/slub.c index 3d63ae320d31b..23fa669934829 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1984,7 +1984,7 @@ static void *get_partial(struct kmem_cache *s, gfp_t flags, int node, return get_any_partial(s, flags, c); } -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION /* * Calculate the next globally unique transaction for disambiguiation * during cmpxchg. The transactions start with the cpu number and are then @@ -2029,7 +2029,7 @@ static inline void note_cmpxchg_failure(const char *n, pr_info("%s %s: cmpxchg redo ", n, s->name); -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION if (tid_to_cpu(tid) != tid_to_cpu(actual_tid)) pr_warn("due to cpu change %d -> %d\n", tid_to_cpu(tid), tid_to_cpu(actual_tid)); @@ -2657,7 +2657,7 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node, unsigned long flags; local_irq_save(flags); -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION /* * We may have been preempted and rescheduled on a different * cpu before disabling interrupts. Need to reload cpu area @@ -2700,13 +2700,13 @@ static __always_inline void *slab_alloc_node(struct kmem_cache *s, * as we end up on the original cpu again when doing the cmpxchg. * * We should guarantee that tid and kmem_cache are retrieved on - * the same cpu. It could be different if CONFIG_PREEMPT so we need + * the same cpu. It could be different if CONFIG_PREEMPTION so we need * to check if it is matched or not. */ do { tid = this_cpu_read(s->cpu_slab->tid); c = raw_cpu_ptr(s->cpu_slab); - } while (IS_ENABLED(CONFIG_PREEMPT) && + } while (IS_ENABLED(CONFIG_PREEMPTION) && unlikely(tid != READ_ONCE(c->tid))); /* @@ -2984,7 +2984,7 @@ static __always_inline void do_slab_free(struct kmem_cache *s, do { tid = this_cpu_read(s->cpu_slab->tid); c = raw_cpu_ptr(s->cpu_slab); - } while (IS_ENABLED(CONFIG_PREEMPT) && + } while (IS_ENABLED(CONFIG_PREEMPTION) && unlikely(tid != READ_ONCE(c->tid))); /* Same with comment on barrier() in slab_alloc_node() */ -- 2.23.0 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 25/34] mm: Use CONFIG_PREEMPTION 2019-10-15 19:18 ` [PATCH 25/34] mm: Use CONFIG_PREEMPTION Sebastian Andrzej Siewior @ 2019-10-16 14:38 ` Christopher Lameter 2019-12-08 14:58 ` [tip: sched/urgent] sched/rt, " tip-bot2 for Thomas Gleixner 1 sibling, 0 replies; 3+ messages in thread From: Christopher Lameter @ 2019-10-16 14:38 UTC (permalink / raw) To: Sebastian Andrzej Siewior Cc: linux-kernel, tglx, Pekka Enberg, David Rientjes, Joonsoo Kim, Andrew Morton, linux-mm Acked-by: Chistoph Lameter <cl@linux.com> ^ permalink raw reply [flat|nested] 3+ messages in thread
* [tip: sched/urgent] sched/rt, mm: Use CONFIG_PREEMPTION 2019-10-15 19:18 ` [PATCH 25/34] mm: Use CONFIG_PREEMPTION Sebastian Andrzej Siewior 2019-10-16 14:38 ` Christopher Lameter @ 2019-12-08 14:58 ` tip-bot2 for Thomas Gleixner 1 sibling, 0 replies; 3+ messages in thread From: tip-bot2 for Thomas Gleixner @ 2019-12-08 14:58 UTC (permalink / raw) To: linux-tip-commits Cc: Thomas Gleixner, Sebastian Andrzej Siewior, Chistoph Lameter, Andrew Morton, David Rientjes, Joonsoo Kim, Linus Torvalds, Pekka Enberg, Peter Zijlstra, linux-mm, Ingo Molnar, x86, LKML The following commit has been merged into the sched/urgent branch of tip: Commit-ID: 923717cbab900fb23b31f16fb31b1d86b09bf702 Gitweb: https://git.kernel.org/tip/923717cbab900fb23b31f16fb31b1d86b09bf702 Author: Thomas Gleixner <tglx@linutronix.de> AuthorDate: Tue, 15 Oct 2019 21:18:12 +02:00 Committer: Ingo Molnar <mingo@kernel.org> CommitterDate: Sun, 08 Dec 2019 14:37:36 +01:00 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> --- mm/memory.c | 2 +- mm/slub.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index 513c3ec..d56883c 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2151,7 +2151,7 @@ static inline int pte_unmap_same(struct mm_struct *mm, pmd_t *pmd, pte_t *page_table, pte_t orig_pte) { int same = 1; -#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT) +#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPTION) if (sizeof(pte_t) > sizeof(unsigned long)) { spinlock_t *ptl = pte_lockptr(mm, pmd); spin_lock(ptl); diff --git a/mm/slub.c b/mm/slub.c index d113897..f7c66dc 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -1964,7 +1964,7 @@ static void *get_partial(struct kmem_cache *s, gfp_t flags, int node, return get_any_partial(s, flags, c); } -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION /* * Calculate the next globally unique transaction for disambiguiation * 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, pr_info("%s %s: cmpxchg redo ", n, s->name); -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION if (tid_to_cpu(tid) != tid_to_cpu(actual_tid)) pr_warn("due to cpu change %d -> %d\n", 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, unsigned long flags; local_irq_save(flags); -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPTION /* * We may have been preempted and rescheduled on a different * cpu before disabling interrupts. Need to reload cpu area @@ -2691,13 +2691,13 @@ redo: * as we end up on the original cpu again when doing the cmpxchg. * * We should guarantee that tid and kmem_cache are retrieved on - * the same cpu. It could be different if CONFIG_PREEMPT so we need + * the same cpu. It could be different if CONFIG_PREEMPTION so we need * to check if it is matched or not. */ do { tid = this_cpu_read(s->cpu_slab->tid); c = raw_cpu_ptr(s->cpu_slab); - } while (IS_ENABLED(CONFIG_PREEMPT) && + } while (IS_ENABLED(CONFIG_PREEMPTION) && unlikely(tid != READ_ONCE(c->tid))); /* @@ -2971,7 +2971,7 @@ redo: do { tid = this_cpu_read(s->cpu_slab->tid); c = raw_cpu_ptr(s->cpu_slab); - } while (IS_ENABLED(CONFIG_PREEMPT) && + } while (IS_ENABLED(CONFIG_PREEMPTION) && unlikely(tid != READ_ONCE(c->tid))); /* Same with comment on barrier() in slab_alloc_node() */ ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-12-08 14:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20191015191821.11479-1-bigeasy@linutronix.de>
2019-10-15 19:18 ` [PATCH 25/34] mm: Use CONFIG_PREEMPTION Sebastian Andrzej Siewior
2019-10-16 14:38 ` Christopher Lameter
2019-12-08 14:58 ` [tip: sched/urgent] sched/rt, " tip-bot2 for Thomas Gleixner
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox