* [PATCH stable 5.15/5.10 0/2] rcu-tasks: Idle tasks on offline CPUs are in quiescent states
@ 2024-11-22 8:46 Krister Johansen
2024-11-22 8:47 ` [PATCH 5.15.y 1/2] " Krister Johansen
2024-11-22 8:48 ` [PATCH 5.10.y 2/2] " Krister Johansen
0 siblings, 2 replies; 5+ messages in thread
From: Krister Johansen @ 2024-11-22 8:46 UTC (permalink / raw)
To: Paul E. McKenney, Neeraj Upadhyay, stable
Cc: Frederic Weisbecker, Joel Fernandes, Josh Triplett, Boqun Feng,
Uladzislau Rezki, Steven Rostedt, Mathieu Desnoyers,
Lai Jiangshan, Zqiang, rcu, David Reaver
Paul, Neeraj, and Stable Team:
I've run into a case with rcu_tasks_postscan where the warning introduced as
part of 46aa886c4("rcu-tasks: Fix IPI failure handling in
trc_wait_for_one_reader") is getting triggered when trc_wait_for_one_reader
sends an IPI to a CPU that is offline. This is occurring on a platform that has
hotplug slots available but not populated. I don't believe the bug is caused by
this change, but I do think that Paul's commit that confines the postscan
operation to just the active CPUs would help prevent this from happening.
Would the RCU maintainers be amenable to having this patch backported to the
5.10 and 5.15 branches as well? I've attached cherry-picks of the relevant
commits to minimize the additional work needed.
Thanks,
-K
Paul E. McKenney (1):
rcu-tasks: Idle tasks on offline CPUs are in quiescent states
kernel/rcu/tasks.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 5.15.y 1/2] rcu-tasks: Idle tasks on offline CPUs are in quiescent states
2024-11-22 8:46 [PATCH stable 5.15/5.10 0/2] rcu-tasks: Idle tasks on offline CPUs are in quiescent states Krister Johansen
@ 2024-11-22 8:47 ` Krister Johansen
2024-11-22 13:51 ` Sasha Levin
2024-11-22 8:48 ` [PATCH 5.10.y 2/2] " Krister Johansen
1 sibling, 1 reply; 5+ messages in thread
From: Krister Johansen @ 2024-11-22 8:47 UTC (permalink / raw)
To: Paul E. McKenney, Neeraj Upadhyay, stable
Cc: Frederic Weisbecker, Joel Fernandes, Josh Triplett, Boqun Feng,
Uladzislau Rezki, Steven Rostedt, Mathieu Desnoyers,
Lai Jiangshan, Zqiang, rcu, David Reaver
From: Paul E. McKenney <paulmck@kernel.org>
commit 5c9a9ca44fda41c5e82f50efced5297a9c19760d upstream
Any idle task corresponding to an offline CPU is in an RCU Tasks Trace
quiescent state. This commit causes rcu_tasks_trace_postscan() to ignore
idle tasks for offline CPUs, which it can do safely due to CPU-hotplug
operations being disabled.
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Neeraj Upadhyay <quic_neeraju@quicinc.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: KP Singh <kpsingh@kernel.org>
Signed-off-by: Krister Johansen <kjlx@templeofstupid.com>
---
kernel/rcu/tasks.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
index 5528c172570b..8648685e7dfa 100644
--- a/kernel/rcu/tasks.h
+++ b/kernel/rcu/tasks.h
@@ -1090,7 +1090,7 @@ static void rcu_tasks_trace_postscan(struct list_head *hop)
{
int cpu;
- for_each_possible_cpu(cpu)
+ for_each_online_cpu(cpu)
rcu_tasks_trace_pertask(idle_task(cpu), hop);
// Re-enable CPU hotplug now that the tasklist scan has completed.
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 5.10.y 2/2] rcu-tasks: Idle tasks on offline CPUs are in quiescent states
2024-11-22 8:46 [PATCH stable 5.15/5.10 0/2] rcu-tasks: Idle tasks on offline CPUs are in quiescent states Krister Johansen
2024-11-22 8:47 ` [PATCH 5.15.y 1/2] " Krister Johansen
@ 2024-11-22 8:48 ` Krister Johansen
2024-11-22 13:51 ` Sasha Levin
1 sibling, 1 reply; 5+ messages in thread
From: Krister Johansen @ 2024-11-22 8:48 UTC (permalink / raw)
To: Paul E. McKenney, Neeraj Upadhyay, stable
Cc: Frederic Weisbecker, Joel Fernandes, Josh Triplett, Boqun Feng,
Uladzislau Rezki, Steven Rostedt, Mathieu Desnoyers,
Lai Jiangshan, Zqiang, rcu, David Reaver
From: Paul E. McKenney <paulmck@kernel.org>
commit 5c9a9ca44fda41c5e82f50efced5297a9c19760d upstream
Any idle task corresponding to an offline CPU is in an RCU Tasks Trace
quiescent state. This commit causes rcu_tasks_trace_postscan() to ignore
idle tasks for offline CPUs, which it can do safely due to CPU-hotplug
operations being disabled.
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Neeraj Upadhyay <quic_neeraju@quicinc.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: KP Singh <kpsingh@kernel.org>
Signed-off-by: Krister Johansen <kjlx@templeofstupid.com>
---
kernel/rcu/tasks.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
index bede3a4f108e..ea45a2d53a99 100644
--- a/kernel/rcu/tasks.h
+++ b/kernel/rcu/tasks.h
@@ -1007,7 +1007,7 @@ static void rcu_tasks_trace_postscan(struct list_head *hop)
{
int cpu;
- for_each_possible_cpu(cpu)
+ for_each_online_cpu(cpu)
rcu_tasks_trace_pertask(idle_task(cpu), hop);
// Re-enable CPU hotplug now that the tasklist scan has completed.
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 5.15.y 1/2] rcu-tasks: Idle tasks on offline CPUs are in quiescent states
2024-11-22 8:47 ` [PATCH 5.15.y 1/2] " Krister Johansen
@ 2024-11-22 13:51 ` Sasha Levin
0 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2024-11-22 13:51 UTC (permalink / raw)
To: stable; +Cc: Krister Johansen, Sasha Levin
[ Sasha's backport helper bot ]
Hi,
The upstream commit SHA1 provided is correct: 5c9a9ca44fda41c5e82f50efced5297a9c19760d
WARNING: Author mismatch between patch and upstream commit:
Backport author: Krister Johansen <kjlx@templeofstupid.com>
Commit author: Paul E. McKenney <paulmck@kernel.org>
Status in newer kernel trees:
6.12.y | Present (exact SHA1)
6.11.y | Present (exact SHA1)
6.6.y | Present (exact SHA1)
6.1.y | Present (exact SHA1)
5.15.y | Not found
Note: The patch differs from the upstream commit:
---
--- - 2024-11-22 08:20:56.541099344 -0500
+++ /tmp/tmp.xl2TPMYb3p 2024-11-22 08:20:56.533807007 -0500
@@ -1,3 +1,5 @@
+commit 5c9a9ca44fda41c5e82f50efced5297a9c19760d upstream
+
Any idle task corresponding to an offline CPU is in an RCU Tasks Trace
quiescent state. This commit causes rcu_tasks_trace_postscan() to ignore
idle tasks for offline CPUs, which it can do safely due to CPU-hotplug
@@ -10,15 +12,16 @@
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: KP Singh <kpsingh@kernel.org>
+Signed-off-by: Krister Johansen <kjlx@templeofstupid.com>
---
kernel/rcu/tasks.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
-index 8fe78a7fecafd..ec68bfe98c958 100644
+index 5528c172570b..8648685e7dfa 100644
--- a/kernel/rcu/tasks.h
+++ b/kernel/rcu/tasks.h
-@@ -1451,7 +1451,7 @@ static void rcu_tasks_trace_postscan(struct list_head *hop)
+@@ -1090,7 +1090,7 @@ static void rcu_tasks_trace_postscan(struct list_head *hop)
{
int cpu;
@@ -27,3 +30,6 @@
rcu_tasks_trace_pertask(idle_task(cpu), hop);
// Re-enable CPU hotplug now that the tasklist scan has completed.
+--
+2.25.1
+
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-5.15.y | Success | Success |
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 5.10.y 2/2] rcu-tasks: Idle tasks on offline CPUs are in quiescent states
2024-11-22 8:48 ` [PATCH 5.10.y 2/2] " Krister Johansen
@ 2024-11-22 13:51 ` Sasha Levin
0 siblings, 0 replies; 5+ messages in thread
From: Sasha Levin @ 2024-11-22 13:51 UTC (permalink / raw)
To: stable; +Cc: Krister Johansen, Sasha Levin
[ Sasha's backport helper bot ]
Hi,
The upstream commit SHA1 provided is correct: 5c9a9ca44fda41c5e82f50efced5297a9c19760d
WARNING: Author mismatch between patch and upstream commit:
Backport author: Krister Johansen <kjlx@templeofstupid.com>
Commit author: Paul E. McKenney <paulmck@kernel.org>
Status in newer kernel trees:
6.12.y | Present (exact SHA1)
6.11.y | Present (exact SHA1)
6.6.y | Present (exact SHA1)
6.1.y | Present (exact SHA1)
5.15.y | Not found
5.10.y | Not found
Note: The patch differs from the upstream commit:
---
--- - 2024-11-22 08:26:15.770984330 -0500
+++ /tmp/tmp.eKXYnEofof 2024-11-22 08:26:15.765204063 -0500
@@ -1,3 +1,5 @@
+commit 5c9a9ca44fda41c5e82f50efced5297a9c19760d upstream
+
Any idle task corresponding to an offline CPU is in an RCU Tasks Trace
quiescent state. This commit causes rcu_tasks_trace_postscan() to ignore
idle tasks for offline CPUs, which it can do safely due to CPU-hotplug
@@ -10,15 +12,16 @@
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: KP Singh <kpsingh@kernel.org>
+Signed-off-by: Krister Johansen <kjlx@templeofstupid.com>
---
kernel/rcu/tasks.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h
-index 8fe78a7fecafd..ec68bfe98c958 100644
+index bede3a4f108e..ea45a2d53a99 100644
--- a/kernel/rcu/tasks.h
+++ b/kernel/rcu/tasks.h
-@@ -1451,7 +1451,7 @@ static void rcu_tasks_trace_postscan(struct list_head *hop)
+@@ -1007,7 +1007,7 @@ static void rcu_tasks_trace_postscan(struct list_head *hop)
{
int cpu;
@@ -27,3 +30,6 @@
rcu_tasks_trace_pertask(idle_task(cpu), hop);
// Re-enable CPU hotplug now that the tasklist scan has completed.
+--
+2.25.1
+
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-5.10.y | Failed | N/A |
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-11-22 13:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-22 8:46 [PATCH stable 5.15/5.10 0/2] rcu-tasks: Idle tasks on offline CPUs are in quiescent states Krister Johansen
2024-11-22 8:47 ` [PATCH 5.15.y 1/2] " Krister Johansen
2024-11-22 13:51 ` Sasha Levin
2024-11-22 8:48 ` [PATCH 5.10.y 2/2] " Krister Johansen
2024-11-22 13:51 ` 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).