[procps] - fix #741090 - ps not displaying nice value for processes with SCHED_BATCH scheduler policy - patch
Jaromír Cápík
jcapik at fedoraproject.org
Mon Jan 30 13:53:57 UTC 2012
commit 08b17beff7a05e67ff4afde35e629d47796f2ffb
Author: Jaromir Capik <jcapik at redhat.com>
Date: Mon Jan 30 14:52:59 2012 +0100
- fix #741090 - ps not displaying nice value for processes with SCHED_BATCH scheduler policy
- patch from Mike Fleetwood
procps-3.2.8-ps-schedbatch.patch | 16 ++++++++++++++++
procps.spec | 11 ++++++++++-
2 files changed, 26 insertions(+), 1 deletions(-)
---
diff --git a/procps-3.2.8-ps-schedbatch.patch b/procps-3.2.8-ps-schedbatch.patch
new file mode 100644
index 0000000..9776cf3
--- /dev/null
+++ b/procps-3.2.8-ps-schedbatch.patch
@@ -0,0 +1,16 @@
+--- procps-3.2.8/ps/output.c.orig 2011-09-22 22:40:44.000000000 +0100
++++ procps-3.2.8/ps/output.c 2011-09-25 09:27:16.000000000 +0100
+@@ -587,8 +587,12 @@
+ return snprintf(outbuf, COLWID, "%ld", -1 - pp->priority);
+ }
+
++// Linux applies nice value in the scheduling policies (classes)
++// SCHED_OTHER(0) and SCHED_BATCH(3). Ref: sched_setscheduler(2).
++// Also print nice value for old kernels which didn't use scheduling
++// policies (-1).
+ static int pr_nice(char *restrict const outbuf, const proc_t *restrict const pp){
+- if(pp->sched!=0 && pp->sched!=-1) return snprintf(outbuf, COLWID, "-");
++ if(pp->sched!=0 && pp->sched!=3 && pp->sched!=-1) return snprintf(outbuf, COLWID, "-");
+ return snprintf(outbuf, COLWID, "%ld", pp->nice);
+ }
+
diff --git a/procps.spec b/procps.spec
index 6674ecb..238ea5e 100644
--- a/procps.spec
+++ b/procps.spec
@@ -3,7 +3,7 @@
Summary: System and process monitoring utilities
Name: procps
Version: 3.2.8
-Release: 25.%{gitver}%{?dist}
+Release: 26.%{gitver}%{?dist}
License: GPLv2+ and LGPLv2+
Group: Applications/System
URL: http://gitorious.org/procps
@@ -74,6 +74,10 @@ Patch49: procps-3.2.8-top-swap.patch
Patch50: procps-3.2.8-kernel3-uts.patch
#723164 - vmstat -t option does not work
Patch51: procps-3.2.7-vmstat-timestamp-getopt.patch
+#741090 - ps not displaying nice value for processes
+# with SCHED_BATCH scheduler policy
+Patch52: procps-3.2.8-ps-schedbatch.patch
+
BuildRequires: ncurses-devel libselinux-devel
@@ -141,6 +145,7 @@ System and process monitoring utilities development headers
%patch49 -p1
%patch50 -p1
%patch51 -p1
+%patch52 -p1
cp %SOURCE1 .
@@ -187,6 +192,10 @@ popd
/%{_lib}/libproc.so
%changelog
+* Mon Jan 30 2012 Jaromir Capik <jcapik at redhat.com> 3.2.8-26.20110302git
+- fix #741090 - ps not displaying nice value for processes with SCHED_BATCH scheduler policy
+- patch from Mike Fleetwood
+
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.2.8-25.20110302git
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
More information about the scm-commits
mailing list