Skip to content

Commit c1972c8

Browse files
paulmckrcuNeeraj Upadhyay
authored andcommitted
locking/csd_lock: Print large numbers as negatives
The CSD-lock-hold diagnostics from CONFIG_CSD_LOCK_WAIT_DEBUG are printed in nanoseconds as unsigned long longs, which is a bit obtuse for human readers when timing bugs result in negative CSD-lock hold times. Yes, there are some people to whom it is immediately obvious that 18446744073709551615 is really -1, but for the rest of us... Therefore, print these numbers as signed long longs, making the negative hold times immediately apparent. Reported-by: Rik van Riel <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Cc: Imran Khan <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Leonardo Bras <[email protected]> Cc: "Peter Zijlstra (Intel)" <[email protected]> Cc: Rik van Riel <[email protected]> Reviewed-by: Rik van Riel <[email protected]> Signed-off-by: Neeraj Upadhyay <[email protected]>
1 parent 8400291 commit c1972c8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/smp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ static bool csd_lock_wait_toolong(call_single_data_t *csd, u64 ts0, u64 *ts1, in
249249
cpu_cur_csd = smp_load_acquire(&per_cpu(cur_csd, cpux)); /* Before func and info. */
250250
/* How long since this CSD lock was stuck. */
251251
ts_delta = ts2 - ts0;
252-
pr_alert("csd: %s non-responsive CSD lock (#%d) on CPU#%d, waiting %llu ns for CPU#%02d %pS(%ps).\n",
253-
firsttime ? "Detected" : "Continued", *bug_id, raw_smp_processor_id(), ts_delta,
252+
pr_alert("csd: %s non-responsive CSD lock (#%d) on CPU#%d, waiting %lld ns for CPU#%02d %pS(%ps).\n",
253+
firsttime ? "Detected" : "Continued", *bug_id, raw_smp_processor_id(), (s64)ts_delta,
254254
cpu, csd->func, csd->info);
255255
/*
256256
* If the CSD lock is still stuck after 5 minutes, it is unlikely

0 commit comments

Comments
 (0)