[PATCH 08/12] unwind: Simplify unwind_user_faultable()

From: Peter Zijlstra
Date: Wed Sep 24 2025 - 04:04:55 EST



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

--- a/kernel/unwind/deferred.c
+++ b/kernel/unwind/deferred.c
@@ -128,17 +128,15 @@ int unwind_user_faultable(struct unwind_

cache = info->cache;
trace->entries = cache->entries;
-
- if (cache->nr_entries) {
+ trace->nr = cache->nr_entries;
+ if (trace->nr) {
/*
* The user stack has already been previously unwound in this
* entry context. Skip the unwind and use the cache.
*/
- trace->nr = cache->nr_entries;
return 0;
}

- trace->nr = 0;
unwind_user(trace, UNWIND_MAX_ENTRIES);

cache->nr_entries = trace->nr;