* [PATCH] rcu: Add missing __releases() annotation
@ 2021-04-28 23:12 Jules Irenge
2021-04-29 18:39 ` Paul E. McKenney
0 siblings, 1 reply; 2+ messages in thread
From: Jules Irenge @ 2021-04-28 23:12 UTC (permalink / raw)
To: rcu
Cc: joel, jiangshanlai, mathieu.desnoyers, rostedt, paulmck,
linux-kernel, Jules Irenge
Sparse report a warning at rcu_print_task_stall()
"warning: context imbalance in rcu_print_task_stall - unexpected unlock"
The root cause is a missing annotation at rcu_print_task_stall() function
Add the missing __releases(rnp->lock) annotation
Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
kernel/rcu/tree_stall.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h
index 59b95cc5cbdf..18b2d5274d65 100644
--- a/kernel/rcu/tree_stall.h
+++ b/kernel/rcu/tree_stall.h
@@ -314,6 +314,7 @@ static void rcu_print_detail_task_stall_rnp(struct rcu_node *rnp)
* tasks blocked within RCU read-side critical sections.
*/
static int rcu_print_task_stall(struct rcu_node *rnp, unsigned long flags)
+ __releases(rnp->lock)
{
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
return 0;
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rcu: Add missing __releases() annotation
2021-04-28 23:12 [PATCH] rcu: Add missing __releases() annotation Jules Irenge
@ 2021-04-29 18:39 ` Paul E. McKenney
0 siblings, 0 replies; 2+ messages in thread
From: Paul E. McKenney @ 2021-04-29 18:39 UTC (permalink / raw)
To: Jules Irenge
Cc: rcu, joel, jiangshanlai, mathieu.desnoyers, rostedt, linux-kernel
On Thu, Apr 29, 2021 at 12:12:19AM +0100, Jules Irenge wrote:
> Sparse report a warning at rcu_print_task_stall()
>
> "warning: context imbalance in rcu_print_task_stall - unexpected unlock"
>
> The root cause is a missing annotation at rcu_print_task_stall() function
>
> Add the missing __releases(rnp->lock) annotation
>
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Good catch, applied, thank you!
Thanx, Paul
> ---
> kernel/rcu/tree_stall.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h
> index 59b95cc5cbdf..18b2d5274d65 100644
> --- a/kernel/rcu/tree_stall.h
> +++ b/kernel/rcu/tree_stall.h
> @@ -314,6 +314,7 @@ static void rcu_print_detail_task_stall_rnp(struct rcu_node *rnp)
> * tasks blocked within RCU read-side critical sections.
> */
> static int rcu_print_task_stall(struct rcu_node *rnp, unsigned long flags)
> + __releases(rnp->lock)
> {
> raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
> return 0;
> --
> 2.31.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-29 18:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-28 23:12 [PATCH] rcu: Add missing __releases() annotation Jules Irenge
2021-04-29 18:39 ` Paul E. McKenney
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).