SHA256
1
0
forked from pool/cpuset
cpuset/Fix-crash-with-SCHED_IDLE-policy.patch
Mike Galbraith ae928f1f52 Accepting request 351159 from home:mgalbraith_external2:branches:hardware
- Merge new cpuset upstream.  Update URL, and add post v1.5.6 fixes.
- New patches:
  Fix-crash-with-SCHED_IDLE-policy.patch (bnc#959992)
  Handle-unknown-scheduler-policy-codes-gracefully.patch (bnc#959992)
  Parse-proc-pid-stat-properly.patch
  Docu-remove-mention-about-nonexistent-option.patch (bnc#957323)
  Docu-fix-asciidoc-build-error.patch
  Update-URLs-after-project-migration.patch
  Docu-fixed-a-typo.patch
  Fix-typo-in-setup-py.patch

OBS-URL: https://build.opensuse.org/request/show/351159
OBS-URL: https://build.opensuse.org/package/show/hardware/cpuset?expand=0&rev=24
2015-12-29 09:11:35 +00:00

40 lines
1.4 KiB
Diff

From de1ae0d598c29b2ae056234f8ecd003e86314871 Mon Sep 17 00:00:00 2001
From: Libor Pechacek <lpechacek@suse.com>
Date: Tue, 22 Dec 2015 09:46:00 +0100
Subject: [PATCH] Fix crash with SCHED_IDLE policy
References: bnc#959992
There are two new schduling policies to be recognized by cset. SCHED_ISO and
SCHED_IDLE. The former is not yet implemented in Linux kernel so we write out
'???' when we encounter its code. For the latter there is the string 'idl'.
Signed-off-by: Libor Pechacek <lpechacek@suse.com>
Signed-off-by: Mike Galbraith <mgalbraith@suse.de>
---
cpuset/commands/proc.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/cpuset/commands/proc.py
+++ b/cpuset/commands/proc.py
@@ -684,7 +684,7 @@ options = [make_option('-l', '--list',
def task_detail(pid, width=70):
# scheduler policy definitions
- policy = ['o', 'f', 'r', 'b']
+ policy = ['o', 'f', 'r', 'b', '?', 'i']
# stat location definitions
statdef = {
'pid': 0,
@@ -732,6 +732,11 @@ options = [make_option('-l', '--list',
out2.append('th')
elif stat[statdef['rtpolicy']] == '3':
out2.append('at')
+ # SCHED_ISO is reserved but not yet implemented as of Linux v4.4
+ elif stat[statdef['rtpolicy']] == '4':
+ out2.append('??')
+ elif stat[statdef['rtpolicy']] == '5':
+ out2.append('dl')
else:
if int(stat[statdef['rtpriority']]) < 10:
out2.append('_')