git: 193c695d7b07 - stable/14 - ps(1), top(1): Priority: Let 0 be the first timesharing level
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 28 Jul 2025 13:31:40 UTC
The branch stable/14 has been updated by olce:
URL: https://cgit.FreeBSD.org/src/commit/?id=193c695d7b071f901a60c971736b22c96565bd70
commit 193c695d7b071f901a60c971736b22c96565bd70
Author: Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2024-09-09 19:35:16 +0000
Commit: Olivier Certner <olce@FreeBSD.org>
CommitDate: 2025-07-28 13:28:43 +0000
ps(1), top(1): Priority: Let 0 be the first timesharing level
Change the origin from PZERO to PUSER.
Doing so allows users to immediately detect if some thread is running
under a high priority (kernel or realtime) or under a low one
(timesharing or idle).
MFC after: 1 month
Event: Kitchener-Waterloo Hackathon 202506
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 1d8f8f3e36fafdb50613d042f5fa75d8cbcf2b8f)
---
bin/ps/print.c | 2 +-
usr.bin/top/machine.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/bin/ps/print.c b/bin/ps/print.c
index c12a8dd8fbe1..5f5f7b23eaec 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -286,7 +286,7 @@ state(KINFO *k, VARENT *ve __unused)
return (buf);
}
-#define scalepri(x) ((x) - PZERO)
+#define scalepri(x) ((x) - PUSER)
char *
pri(KINFO *k, VARENT *ve __unused)
diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c
index 07a7119ad0c2..8c035b5df383 100644
--- a/usr.bin/top/machine.c
+++ b/usr.bin/top/machine.c
@@ -1134,7 +1134,7 @@ format_next_process(struct handle * xhandle, char *(*get_userid)(int), int flags
sbuf_printf(procbuf, " ");
}
- sbuf_printf(procbuf, "%3d ", pp->ki_pri.pri_level - PZERO);
+ sbuf_printf(procbuf, "%3d ", pp->ki_pri.pri_level - PUSER);
sbuf_printf(procbuf, "%4s", format_nice(pp));
sbuf_printf(procbuf, "%7s ", format_k(PROCSIZE(pp)));
sbuf_printf(procbuf, "%6s ", format_k(pagetok(pp->ki_rssize)));