[PATCH 07/12] unwind: Clarify calling context

Peter Zijlstra posted 12 patches 1 week ago
[PATCH 07/12] unwind: Clarify calling context
Posted by Peter Zijlstra 1 week ago
The get_cookie() function hard relies on IRQs being disabled, but this
isn't immediately obvious when reading the function.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 kernel/unwind/deferred.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/kernel/unwind/deferred.c
+++ b/kernel/unwind/deferred.c
@@ -79,6 +79,8 @@ static u64 get_cookie(struct unwind_task
 {
 	u32 cnt = 1;
 
+	lockdep_assert_irqs_disabled();
+
 	if (info->id.cpu)
 		return info->id.id;
Re: [PATCH 07/12] unwind: Clarify calling context
Posted by Steven Rostedt 10 hours ago
On Wed, 24 Sep 2025 09:59:55 +0200
Peter Zijlstra <peterz@infradead.org> wrote:

> The get_cookie() function hard relies on IRQs being disabled, but this
> isn't immediately obvious when reading the function.
> 
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>

Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>

-- Steve

> ---
>  kernel/unwind/deferred.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> --- a/kernel/unwind/deferred.c
> +++ b/kernel/unwind/deferred.c
> @@ -79,6 +79,8 @@ static u64 get_cookie(struct unwind_task
>  {
>  	u32 cnt = 1;
>  
> +	lockdep_assert_irqs_disabled();
> +
>  	if (info->id.cpu)
>  		return info->id.id;
>  
>