mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] sched/debug: correct printing for rq->nr_uninterruptible
@ 2023-05-06  7:42 晏艳(采苓)
  2023-05-10 13:49 ` [tip: sched/core] sched/debug: Correct " tip-bot2 for 晏艳(采苓)
  0 siblings, 1 reply; 2+ messages in thread
From: 晏艳(采苓) @ 2023-05-06  7:42 UTC (permalink / raw)
  To: linux-kernel
  Cc: 谈鉴锋,
	Tiwei Bie, peterz, 晏艳(采苓),
	Ingo Molnar, Juri Lelli, Vincent Guittot, Dietmar Eggemann,
	Steven Rostedt, Ben Segall, Mel Gorman,
	Daniel Bristot de Oliveira, Valentin Schneider

Commit e6fe3f422be1 ("sched: Make multiple runqueue task counters
32-bit") changed the type for rq->nr_uninterruptible from "unsigned
long" to "unsigned int", but left wrong cast print to
/sys/kernel/debug/sched/debug and to the console.

For example, nr_uninterruptible's value is fffffff7 with type
"unsigned int", (long)nr_uninterruptible shows 4294967287 while
(int)nr_uninterruptible prints -9. So using int cast fixes wrong
printing.

Signed-off-by: Yan Yan <yanyan.yan@antgroup.com>
---
 kernel/sched/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 667876da8382..ac6684cd4ae4 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -730,7 +730,7 @@ static void print_cpu(struct seq_file *m, int cpu)
 #define P(x)								\
 do {									\
 	if (sizeof(rq->x) == 4)						\
-		SEQ_printf(m, "  .%-30s: %ld\n", #x, (long)(rq->x));	\
+		SEQ_printf(m, "  .%-30s: %d\n", #x, (int)(rq->x));	\
 	else								\
 		SEQ_printf(m, "  .%-30s: %Ld\n", #x, (long long)(rq->x));\
 } while (0)
-- 
2.32.0.3.g01195cf9f


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-10 13:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-06  7:42 [PATCH v2] sched/debug: correct printing for rq->nr_uninterruptible 晏艳(采苓)
2023-05-10 13:49 ` [tip: sched/core] sched/debug: Correct " tip-bot2 for 晏艳(采苓)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®