Lev Makhlis writes:
> I have noticed that when the scheduling policy of a process is SCHED_FIFO
> or SCHED_RR, proc_pid_stat() in fs/proc/array.c still uses the counter field
> in the task structure to calculate the priority in /proc/<pid>/stat.
> For such processes, the counter field is ignored by the scheduler in favour
> of the rt_priority field. Thus, even though the actual priority is available
> via sched_getparam(2), the priority in /proc/<pid>/stat -- and, consequently,
> in the output of ps(1) and top(1) -- seems to be, for SCHED_FIFO/SCHED_RR
> processes, a value that is not representative at all of how the process is
> scheduled.
>
> I have thrown together a patch to address this, but I can't say I feel
> entirely comfortable about scaling from 1..99 to -20..20.
Do not do this. Just supply the raw value for ps(1) and top(1) to use.
Also supply the scheduling policy type. You can tack this on the end
of /proc/<pid>/stat and tell me when Linus accepts it so that I can
make ps(1) and top(1) support the new info.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Fri Nov 23 2001 - 21:00:19 EST