public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: __set_cpus_allowed_ptr(): Check cpus_mask, not cpus_ptr
@ 2020-06-17 12:17 Sebastian Andrzej Siewior
  2020-06-17 14:15 ` Valentin Schneider
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sebastian Andrzej Siewior @ 2020-06-17 12:17 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Peter Zijlstra, Juri Lelli, Vincent Guittot,
	Dietmar Eggemann, Steven Rostedt, Ben Segall, Mel Gorman,
	Thomas Gleixner, Scott Wood

From: Scott Wood <swood@redhat.com>

This function is concerned with the long-term cpu mask, not the
transitory mask the task might have while migrate disabled.  Before
this patch, if a task was migrate disabled at the time
__set_cpus_allowed_ptr() was called, and the new mask happened to be
equal to the cpu that the task was running on, then the mask update
would be lost.

Signed-off-by: Scott Wood <swood@redhat.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 kernel/sched/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1637,7 +1637,7 @@ static int __set_cpus_allowed_ptr(struct
 		goto out;
 	}
 
-	if (cpumask_equal(p->cpus_ptr, new_mask))
+	if (cpumask_equal(&p->cpus_mask, new_mask))
 		goto out;
 
 	/*

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

end of thread, other threads:[~2020-06-23  8:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-17 12:17 [PATCH] sched: __set_cpus_allowed_ptr(): Check cpus_mask, not cpus_ptr Sebastian Andrzej Siewior
2020-06-17 14:15 ` Valentin Schneider
2020-06-17 22:49   ` Scott Wood
2020-06-18  8:07     ` Sebastian Andrzej Siewior
2020-06-18  8:51       ` Valentin Schneider
2020-06-23  7:19 ` [tip: sched/urgent] " tip-bot2 for Scott Wood
2020-06-23  8:48 ` [tip: sched/urgent] sched/core: Check cpus_mask, not cpus_ptr in __set_cpus_allowed_ptr(), to fix mask corruption tip-bot2 for Scott Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox