[PATCH] lib/smp_processor_id: fix imbalanced instrumentation_end() call

Tetsuo Handa posted 1 patch 3 years, 10 months ago
lib/smp_processor_id.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] lib/smp_processor_id: fix imbalanced instrumentation_end() call
Posted by Tetsuo Handa 3 years, 10 months ago
Currently instrumentation_end() won't be called if printk_ratelimit()
returned false.

Fixes: 126f21f0e8d46e2c ("lib/smp_processor_id: Move it into noinstr section")
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
---
 lib/smp_processor_id.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c
index 046ac6297c78..a2bb7738c373 100644
--- a/lib/smp_processor_id.c
+++ b/lib/smp_processor_id.c
@@ -47,9 +47,9 @@ unsigned int check_preemption_disabled(const char *what1, const char *what2)
 
 	printk("caller is %pS\n", __builtin_return_address(0));
 	dump_stack();
-	instrumentation_end();
 
 out_enable:
+	instrumentation_end();
 	preempt_enable_no_resched_notrace();
 out:
 	return this_cpu;
-- 
2.18.4
Re: [PATCH] lib/smp_processor_id: fix imbalanced instrumentation_end() call
Posted by Tetsuo Handa 3 years, 9 months ago
It seems that nobody is interested in this patch.

Andrew, can you take this patch and
https://lkml.kernel.org/r/225b0c28-8333-9849-0d7b-2a561fb20ccb@I-love.SAKURA.ne.jp ?

On 2022/06/22 14:46, Tetsuo Handa wrote:
> Currently instrumentation_end() won't be called if printk_ratelimit()
> returned false.
> 
> Fixes: 126f21f0e8d46e2c ("lib/smp_processor_id: Move it into noinstr section")
> Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> ---
>  lib/smp_processor_id.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/smp_processor_id.c b/lib/smp_processor_id.c
> index 046ac6297c78..a2bb7738c373 100644
> --- a/lib/smp_processor_id.c
> +++ b/lib/smp_processor_id.c
> @@ -47,9 +47,9 @@ unsigned int check_preemption_disabled(const char *what1, const char *what2)
>  
>  	printk("caller is %pS\n", __builtin_return_address(0));
>  	dump_stack();
> -	instrumentation_end();
>  
>  out_enable:
> +	instrumentation_end();
>  	preempt_enable_no_resched_notrace();
>  out:
>  	return this_cpu;