linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.9 1/5] kernel/cpu: add arch override for clear_tasks_mm_cpumask() mm handling
@ 2020-12-12 16:09 Sasha Levin
  2020-12-12 16:09 ` [PATCH AUTOSEL 4.9 2/5] drm/nouveau: make sure ret is initialized in nouveau_ttm_io_mem_reserve Sasha Levin
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sasha Levin @ 2020-12-12 16:09 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Nicholas Piggin, Aneesh Kumar K . V, Peter Zijlstra,
	Michael Ellerman, Sasha Levin

From: Nicholas Piggin <npiggin@gmail.com>

[ Upstream commit 8ff00399b153440c1c83e20c43020385b416415b ]

powerpc/64s keeps a counter in the mm which counts bits set in
mm_cpumask as well as other things. This means it can't use generic code
to clear bits out of the mask and doesn't adjust the arch specific
counter.

Add an arch override that allows powerpc/64s to use
clear_tasks_mm_cpumask().

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201126102530.691335-4-npiggin@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/cpu.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/kernel/cpu.c b/kernel/cpu.c
index a542b5e583503..e005209f279e1 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -815,6 +815,10 @@ void __unregister_cpu_notifier(struct notifier_block *nb)
 EXPORT_SYMBOL(__unregister_cpu_notifier);
 
 #ifdef CONFIG_HOTPLUG_CPU
+#ifndef arch_clear_mm_cpumask_cpu
+#define arch_clear_mm_cpumask_cpu(cpu, mm) cpumask_clear_cpu(cpu, mm_cpumask(mm))
+#endif
+
 /**
  * clear_tasks_mm_cpumask - Safely clear tasks' mm_cpumask for a CPU
  * @cpu: a CPU id
@@ -850,7 +854,7 @@ void clear_tasks_mm_cpumask(int cpu)
 		t = find_lock_task_mm(p);
 		if (!t)
 			continue;
-		cpumask_clear_cpu(cpu, mm_cpumask(t->mm));
+		arch_clear_mm_cpumask_cpu(cpu, t->mm);
 		task_unlock(t);
 	}
 	rcu_read_unlock();
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-12 16:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-12 16:09 [PATCH AUTOSEL 4.9 1/5] kernel/cpu: add arch override for clear_tasks_mm_cpumask() mm handling Sasha Levin
2020-12-12 16:09 ` [PATCH AUTOSEL 4.9 2/5] drm/nouveau: make sure ret is initialized in nouveau_ttm_io_mem_reserve Sasha Levin
2020-12-12 16:09 ` [PATCH AUTOSEL 4.9 3/5] drm/tegra: sor: Disable clocks on error in tegra_sor_init() Sasha Levin
2020-12-12 16:09 ` [PATCH AUTOSEL 4.9 4/5] scsi: mpt3sas: Increase IOCInit request timeout to 30s Sasha Levin
2020-12-12 16:09 ` [PATCH AUTOSEL 4.9 5/5] dm table: Remove BUG_ON(in_interrupt()) Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).