diff options
author | Adrian Knoth | 2010-02-02 17:18:29 +0100 |
---|---|---|
committer | Karel Zak | 2010-02-02 18:16:05 +0100 |
commit | 0fefbedc72f5b8399be50ae0aad8eb9cb3b630a3 (patch) | |
tree | fdb8a2b72cd5a26c50bb53672c7b2d47a58eadb8 | |
parent | libblkid: minor fixes in befs.c (diff) | |
download | kernel-qcow2-util-linux-0fefbedc72f5b8399be50ae0aad8eb9cb3b630a3.tar.gz kernel-qcow2-util-linux-0fefbedc72f5b8399be50ae0aad8eb9cb3b630a3.tar.xz kernel-qcow2-util-linux-0fefbedc72f5b8399be50ae0aad8eb9cb3b630a3.zip |
chrt: add support for SCHED_RESET_ON_FORK
From 9262c9832134f8a33ac2ea2854dc6d20acc712d1 Mon Sep 17 00:00:00 2001
From: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Date: Tue, 2 Feb 2010 16:57:23 +0100
Subject: [PATCH] Add support for SCHED_RESET_ON_FORK to chrt
SCHED_RESET_ON_FORK has been added in 2.6.31. If a thread has this flag
set, chrt reports "unknown" policy, which is confusing.
The patch adds support for this new flag. It will (can) only be applied
to SCHED_FIFO or SCHED_RR, so there's no need to catch the other
scheduling policies.
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
-rw-r--r-- | schedutils/chrt.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/schedutils/chrt.c b/schedutils/chrt.c index 6953addd7..6629c2e80 100644 --- a/schedutils/chrt.c +++ b/schedutils/chrt.c @@ -47,6 +47,11 @@ # define SCHED_IDLE 5 #endif +#if defined(__linux__) && !defined(SCHED_RESET_ON_FORK) +#define SCHED_RESET_ON_FORK 0x40000000 +#endif + + static void show_usage(int rc) { fprintf(stdout, _( @@ -92,6 +97,9 @@ static void show_rt_info(const char *what, pid_t pid) case SCHED_FIFO: printf("SCHED_FIFO\n"); break; + case SCHED_FIFO|SCHED_RESET_ON_FORK: + printf("SCHED_FIFO|SCHED_RESET_ON_FORK\n"); + break; #ifdef SCHED_IDLE case SCHED_IDLE: printf("SCHED_IDLE\n"); @@ -100,6 +108,9 @@ static void show_rt_info(const char *what, pid_t pid) case SCHED_RR: printf("SCHED_RR\n"); break; + case SCHED_RR|SCHED_RESET_ON_FORK: + printf("SCHED_RR|SCHED_RESET_ON_FORK\n"); + break; #ifdef SCHED_BATCH case SCHED_BATCH: printf("SCHED_BATCH\n"); |