Skip to content

Commit c0472b0

Browse files
author
Vladimir Kotal
committed
update the renice example to fit current behavior
1 parent b06520b commit c0472b0

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

proc.tex

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -325,24 +325,23 @@
325325
\item The priority class and nice value of a given process can be displayed with
326326
the \texttt{-l} option of the \texttt{ps} command or by explicitly specifying
327327
the fields to be printed out (see the \texttt{-o} option).
328-
\item Example: priority values have different scales on different systems. E.g.
329-
on macOS~10.9 a process that had the priority value 30 will have the value
330-
decremented to 21 after increasing the nice value:
328+
\item The \texttt{renice} command can be used to manipulate the priority/nice
329+
value. Non privileged users can only increase the nice value (example from
330+
mac OS 10.13):
331331
\begin{verbatim}
332-
$ sleep 200 &
332+
$ /bin/sleep 200 & # use /bin/sleep to avoid invoking shell built-in
333333
[1] 36877
334334
$ ps -O pri,nice -p $!
335335
PID PRI NI TT STAT TIME COMMAND
336336
36877 31 0 s003 S 0:00.00 sleep 200
337337
$ renice 10 -p $!
338338
$ ps -O pri,nice -p $!
339339
PID PRI NI TT STAT TIME COMMAND
340-
36877 21 10 s003 SN 0:00.00 sleep 200
340+
36877 31 10 s003 SN 0:00.00 sleep 200
341341
\end{verbatim}
342342

343-
With Linux kernel 3.10 it will look differently -- the priority value will be
344-
increased after a nice value increases. However, that means the process will be
345-
running with a smaller priority.
343+
On Linux (kernel 5.10) this will look differently - after the \texttt{renice}
344+
is run, the priority will be increased by the nice value.
346345
\end{itemize}
347346

348347
%%%%%

0 commit comments

Comments
 (0)