Thread (37 messages) flat view 37 messages, 6 authors, 2022-02-04

Re: [PATCH v3 2/4] sched: Introduce migratable()

From: Valentin Schneider <hidden>
Date: 2021-08-22 17:31:24
Also in: linux-rt-users, lkml, rcu

On 17/08/21 16:43, Sebastian Andrzej Siewior wrote:
On 2021-08-11 21:13:52 [+0100], Valentin Schneider wrote:
quoted
diff --git a/include/linux/sched.h b/include/linux/sched.h
index debc960f41e3..8ba7b4a7ee69 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1715,6 +1715,16 @@ static inline bool is_percpu_thread(void)
 #endif
 }

+/* Is the current task guaranteed to stay on its current CPU? */
+static inline bool migratable(void)
+{
+#ifdef CONFIG_SMP
+	return preemptible() && !current->migration_disabled;
+#else
+	return true;
shouldn't this be false in the UP case?
Yes indeed, forgot to flip that one when inverting the logic.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help