* FAILED: patch "[PATCH] tracing/osnoise: Fix missed cpus_read_unlock() in" failed to apply to 5.14-stable tree
@ 2021-09-15 12:37 gregkh
2021-09-15 14:12 ` Steven Rostedt
0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2021-09-15 12:37 UTC (permalink / raw)
To: qiang.zhang, bristot, rostedt, stable; +Cc: stable
The patch below does not apply to the 5.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 4b6b08f2e45edda4c067ac40833e3c1f84383c0b Mon Sep 17 00:00:00 2001
From: "Qiang.Zhang" <qiang.zhang@windriver.com>
Date: Tue, 31 Aug 2021 10:29:19 +0800
Subject: [PATCH] tracing/osnoise: Fix missed cpus_read_unlock() in
start_per_cpu_kthreads()
When start_kthread() return error, the cpus_read_unlock() need
to be called.
Link: https://lkml.kernel.org/r/20210831022919.27630-1-qiang.zhang@windriver.com
Cc: <stable@vger.kernel.org>
Fixes: c8895e271f79 ("trace/osnoise: Support hotplug operations")
Acked-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Signed-off-by: Qiang.Zhang <qiang.zhang@windriver.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
index 65b08b8e5bf8..ce053619f289 100644
--- a/kernel/trace/trace_osnoise.c
+++ b/kernel/trace/trace_osnoise.c
@@ -1548,7 +1548,7 @@ static int start_kthread(unsigned int cpu)
static int start_per_cpu_kthreads(struct trace_array *tr)
{
struct cpumask *current_mask = &save_cpumask;
- int retval;
+ int retval = 0;
int cpu;
cpus_read_lock();
@@ -1568,13 +1568,13 @@ static int start_per_cpu_kthreads(struct trace_array *tr)
retval = start_kthread(cpu);
if (retval) {
stop_per_cpu_kthreads();
- return retval;
+ break;
}
}
cpus_read_unlock();
- return 0;
+ return retval;
}
#ifdef CONFIG_HOTPLUG_CPU
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: FAILED: patch "[PATCH] tracing/osnoise: Fix missed cpus_read_unlock() in" failed to apply to 5.14-stable tree
2021-09-15 12:37 FAILED: patch "[PATCH] tracing/osnoise: Fix missed cpus_read_unlock() in" failed to apply to 5.14-stable tree gregkh
@ 2021-09-15 14:12 ` Steven Rostedt
2021-09-16 14:01 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2021-09-15 14:12 UTC (permalink / raw)
To: gregkh; +Cc: qiang.zhang, bristot, stable
On Wed, 15 Sep 2021 14:37:10 +0200
<gregkh@linuxfoundation.org> wrote:
>
> cpus_read_unlock();
>
> - return 0;
> + return retval;
> }
>
The issue was that the latest kernel uses cpu_read_unlock() instead of
put_online_cpus(), other than that, it was trivial to fix.
Below should apply cleanly to 5.14.
-- Steve
>From 4b6b08f2e45edda4c067ac40833e3c1f84383c0b Mon Sep 17 00:00:00 2001
From: "Qiang.Zhang" <qiang.zhang@windriver.com>
Date: Tue, 31 Aug 2021 10:29:19 +0800
Subject: [PATCH] tracing/osnoise: Fix missed cpus_read_unlock() in
start_per_cpu_kthreads()
When start_kthread() return error, the cpus_read_unlock() need
to be called.
Link: https://lkml.kernel.org/r/20210831022919.27630-1-qiang.zhang@windriver.com
Cc: <stable@vger.kernel.org>
Fixes: c8895e271f79 ("trace/osnoise: Support hotplug operations")
Acked-by: Daniel Bristot de Oliveira <bristot@kernel.org>
Signed-off-by: Qiang.Zhang <qiang.zhang@windriver.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Index: linux-test.git/kernel/trace/trace_osnoise.c
===================================================================
--- linux-test.git.orig/kernel/trace/trace_osnoise.c
+++ linux-test.git/kernel/trace/trace_osnoise.c
@@ -1548,7 +1548,7 @@ static int start_kthread(unsigned int cp
static int start_per_cpu_kthreads(struct trace_array *tr)
{
struct cpumask *current_mask = &save_cpumask;
- int retval;
+ int retval = 0;
int cpu;
get_online_cpus();
@@ -1568,13 +1568,13 @@ static int start_per_cpu_kthreads(struct
retval = start_kthread(cpu);
if (retval) {
stop_per_cpu_kthreads();
- return retval;
+ break;
}
}
put_online_cpus();
- return 0;
+ return retval;
}
#ifdef CONFIG_HOTPLUG_CPU
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: FAILED: patch "[PATCH] tracing/osnoise: Fix missed cpus_read_unlock() in" failed to apply to 5.14-stable tree
2021-09-15 14:12 ` Steven Rostedt
@ 2021-09-16 14:01 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2021-09-16 14:01 UTC (permalink / raw)
To: Steven Rostedt; +Cc: qiang.zhang, bristot, stable
On Wed, Sep 15, 2021 at 10:12:31AM -0400, Steven Rostedt wrote:
> On Wed, 15 Sep 2021 14:37:10 +0200
> <gregkh@linuxfoundation.org> wrote:
>
> >
> > cpus_read_unlock();
> >
> > - return 0;
> > + return retval;
> > }
> >
>
> The issue was that the latest kernel uses cpu_read_unlock() instead of
> put_online_cpus(), other than that, it was trivial to fix.
>
> Below should apply cleanly to 5.14.
Now queued up, thanks.
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-16 14:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15 12:37 FAILED: patch "[PATCH] tracing/osnoise: Fix missed cpus_read_unlock() in" failed to apply to 5.14-stable tree gregkh
2021-09-15 14:12 ` Steven Rostedt
2021-09-16 14:01 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.