SHA256
1
0
forked from pool/cpuset
cpuset/Fix-crash-with-SCHED_IDLE-policy.patch

40 lines
1.4 KiB
Diff
Raw Normal View History

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('_')