Command line and full screen utilities for browsing procfs, a "pseudo" file system dynamically generated by Linux to provide information about the status of entries in its process table.
Go to file
Mike Fleetwood 2bac5334b0 ps: display the nice value for processes with the SCHED_BATCH scheduler policy
Ps command does not display the nice value for processes with the SCHED_BATCH
scheduler policy, only for SCHED_OTHER.

Boinc (http://boinc.berkeley.edu/) client runs project processing jobs on
Linux using SCHED_BATCH scheduler policy and nice value 19.  The nice value
is not displayable by ps.

Steps to Reproduce:
1. Run process using SCHED_BATCH scheduler policy with nice value.
    ./test-schedbatch 18 &
2. Display process details:
    ps -o pid,ppid,user,comm,cls,nice

Results before:
[mike@rockover c]$ ps -o pid,ppid,user,comm,cls,nice
  PID  PPID USER     COMMAND         CLS  NI
18205  2540 mike     bash             TS   0
20552 18205 mike     test-schedbatch   B   -
20553 18205 mike     ps               TS   0
[mike@rockover c]$ awk '{printf "%5d %-17s %1d %2d\n", $1, $2, $41, $19}'
/proc/20552/stat
20552 (test-schedbatch) 3 18

Results after this patch:
[mike@rockover c]$ ps -o pid,ppid,user,comm,cls,nice
  PID  PPID USER     COMMAND         CLS  NI
18205  2540 mike     bash             TS   0
20552 18205 mike     test-schedbatch   B  18
20553 18205 mike     ps               TS   0

Additional info: Here is the fragment from the sched_setscheduler(2) manual
page on the subject:

   SCHED_BATCH: Scheduling batch processes
       (Since  Linux 2.6.16.)  SCHED_BATCH can only be used at static
       priority 0.  This policy is similar to SCHED_OTHER in that it
       schedules the process according to its dynamic priority (based on the
       nice value).  The difference is that this policy will cause the
       scheduler to always assume that the process is CPU-intensive.
       Consequently, the scheduler will apply a small scheduling penalty with
       respect to wakeup behaviour, so that this process is mildly disfavored
       in scheduling decisions.

       This policy is useful for workloads that are noninteractive, but do
       not want to lower their nice value, and for workloads that want a
       determin- istic scheduling policy without interactivity causing extra
       preemptions (between the workload's tasks).

Reference: https://bugzilla.redhat.com/show_bug.cgi?id=741090
Acked-by: Jaromir Capik <jcapik@redhat.com>
Acked-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Mike Fleetwood <mike.fleetwood@googlemail.com>
2012-01-09 21:37:41 +01:00
contrib contrib: minimal ps: define mips PAGE_SIZE 2011-12-18 22:25:11 +11:00
Documentation other: indent FAQ file 2012-01-08 21:57:35 +01:00
include Changed the err and warns to macros 2012-01-03 18:48:43 +11:00
lib build-sys: use dist-xz 2012-01-08 23:02:17 +01:00
po build-sys: use Makevars --add-comments= to limit .pot comments 2011-12-20 17:30:52 +01:00
proc Linux version for non-linux systems 2012-01-09 21:57:44 +11:00
ps ps: display the nice value for processes with the SCHED_BATCH scheduler policy 2012-01-09 21:37:41 +01:00
testsuite tests: add SCHED_BATCH test 2012-01-09 21:37:41 +01:00
tools build-sys: use git version as package version 2012-01-08 21:35:07 +01:00
top top: add PACKAGE and LOCALEDIR to ATEOJ_RPTSTD output 2012-01-05 09:56:05 +11:00
.gitignore build-sys: use dist-xz 2012-01-08 23:02:17 +01:00
AUTHORS watch: support unicode 2011-12-19 21:57:09 +11:00
autogen.sh top: provide extensive, generalized nls support 2011-12-22 23:48:04 +11:00
ChangeLog build-sys: take autotools in use again 2011-06-04 17:22:44 +02:00
configure.ac build-sys: use dist-xz 2012-01-08 23:02:17 +01:00
COPYING resync due to auto* 2002-09-27 13:26:07 +00:00
COPYING.LIB procps 010114 2002-02-01 22:47:29 +00:00
free.1 docs: fix free.1 groff syntax 2011-12-20 17:17:03 +01:00
free.c For free -b make the variable a long long 2012-01-05 09:46:39 +11:00
kill.1 docs: add long options to kill.1 2011-12-20 17:30:53 +01:00
Makefile.am watch needs a conditonal LDADD 2012-01-09 21:40:53 +11:00
NEWS Updated NEWS with new items for procps-ng 3.3.2 2012-01-06 16:48:09 +11:00
pgrep.1 docs: mention long options in man pgrep.1 2011-12-20 17:17:02 +01:00
pgrep.c pgrep: correction to usage output 2012-01-06 00:17:44 +11:00
pkill.1 procps 010114 2002-02-01 22:47:29 +00:00
pmap.1 docs: add exit values to pmap manual page 2011-12-20 17:30:54 +01:00
pmap.c Changed the err and warns to macros 2012-01-03 18:48:43 +11:00
pwdx.1 docs: mention long options in man pwdx.1 2011-12-20 17:17:01 +01:00
pwdx.c pwdx: re-create invalid process id check 2012-01-08 21:29:51 +01:00
README name change: procps -> procps-ng 2011-06-04 20:50:12 +02:00
skill.1 dosc: add long options to skill.1 2011-12-20 17:30:53 +01:00
skill.c Changed the err and warns to macros 2012-01-03 18:48:43 +11:00
slabtop.1 docs: clarify slabtop sort criteria listing 2012-01-06 16:10:10 +11:00
slabtop.c slabtop: total slabs & caches header fix 2012-01-06 16:10:09 +11:00
snice.1 procps 010114 2002-02-01 22:47:29 +00:00
sysctl.8 sysctl: implement --pattern option 2011-12-20 17:17:03 +01:00
sysctl.c Changed the err and warns to macros 2012-01-03 18:48:43 +11:00
sysctl.conf misc 2004-08-18 02:22:13 +00:00
sysctl.conf.5 docs: add preload paths to sysctl.conf.5 2012-01-06 16:12:22 +11:00
tload.1 docs: mention long options in man tload.1 2011-12-20 17:17:01 +01:00
tload.c Changed the err and warns to macros 2012-01-03 18:48:43 +11:00
uptime.1 misc: trailing space/tab cleanup following rebase 2011-12-20 17:30:51 +01:00
uptime.c Changed the err and warns to macros 2012-01-03 18:48:43 +11:00
vmstat.8 docs: mention long options in man vmstat.8 2011-12-20 17:17:03 +01:00
vmstat.c Changed the err and warns to macros 2012-01-03 18:48:43 +11:00
w.1 docs: mention long options in man w.1 2011-12-20 17:17:01 +01:00
w.c w: indicate unknown host when -f is used 2012-01-08 21:31:56 +01:00
watch.1 docs: watch manual update about -e option behaviour change 2012-01-06 00:18:07 +11:00
watch.c watch: correct differences option, eliminate duplicate help text 2012-01-05 10:07:08 +11:00

COMPATIBILITY

    This code is intended for use with Linux 2.2.xx, 2.4.xx,
    2.6.xx, and hopefully all future kernels. You should be
    running a system with libc 6, but libc 5 might work too.

INSTALLATION

    make
    make install

    Only the second ("make install") is needed if you just
    want to build and install procps-ng in the normal way.

    If you wish to test before installing, use the scripts
    named t, v, and p to ensure that the correct libproc
    (the new one) is used during your testing.

    You may set SKIP to avoid building or installing things.
    For example:

    make SKIP='/bin/kill /usr/share/man/man1/kill.1' install

    Use SHARED=0 to build procps-ng without shared libraries.
    This may be useful for installing in your home directory.

    make SHARED=0 DESTDIR=$HOME install

    Suppose you wanted to install stuff in strange places.
    You might do something like this:

    make usr/bin=/tmp/Q/i/ DESTDIR=/tmp/Q install="install -D" ldconfig=echo install

    If cross-compiling, you might need to set lib64 to
    either "lib" or "lib64". You might need to set m64 to
    -m64, -m32, or nothing at all. Some examples:

    make lib64=lib m64=-m32      # for a bi-arch gcc
    make lib64=lib64 CC=x86_64-gcc
    make lib64=lib CC=alpha-gcc

PACKAGING

    If you are a downstream maintainer (packager) for a Linux distribution,
    please avoid causing troubles. This section applies to you.

    Send patches in regularly. Many patches made by vendors have been buggy,
    some quite severely so. Sending in a patch will at least get it reviewed,
    if not included. There is a procps-ng test suite that must be passed.
    Forward all bug reports. If your bug database is public and busy enough
    to bother with, please make this known. Follow Debian's lead in making
    the bug database easy to comment on via email w/o need for an account.

    Do not change the user interface. Many of the programs are intended to be
    compatible with Solaris, FreeBSD, AIX, IRIX, Tru64, and the UNIX standard.
    Your nice new command options WILL BE BROKEN as needed to ensure that
    procps-ng remains compatible with the rest of the world. Sysadmins hate to
    deal with incompatible behavior. If you need a new option, ask for it.

    For normal packages, ensure that you do not add debugging flags
    to the CFLAGS variable. If debugging flags are present, the Makefile
    will avoid adding several optimizations that would interfere with gdb.

    There should be no need to modify the Makefile. You can set variables
    on the "make" command line or use "make -e" to pass variables from
    the environment.

BUG REPORTS

    Email to procps@freelists.org.