diff options
author | Dongsheng Yang <yangds.fnst@cn.fujitsu.com> | 2014-01-27 17:15:37 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-02-09 07:31:49 -0500 |
commit | 5c228079ce8a9bb043a423069a6674dfb9268037 (patch) | |
tree | d41bec8bc0723583902f002e1237ba915ebbbdc2 | |
parent | 390f3258cb2d031f1c17aa32e771ebd336e89073 (diff) |
sched: Move the priority specific bits into a new header file
Some bits about priority are defined in linux/sched/rt.h, but
some of them are not only for rt scheduler, such as MAX_PRIO.
This patch move them all into a new header file, linux/sched/prio.h.
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Cc: clark.williams@gmail.com
Cc: rostedt@goodmis.org
Cc: raistlin@linux.it
Cc: juri.lelli@gmail.com
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/f7549508a1588da2c613d601748ca9de30fa5dcf.1390859827.git.yangds.fnst@cn.fujitsu.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | include/linux/sched.h | 2 | ||||
-rw-r--r-- | include/linux/sched/prio.h | 23 | ||||
-rw-r--r-- | include/linux/sched/rt.h | 19 |
3 files changed, 26 insertions, 18 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index ed867797fe5a..d97d0a8e87dc 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #include <uapi/linux/sched.h> | 4 | #include <uapi/linux/sched.h> |
5 | 5 | ||
6 | #include <linux/sched/prio.h> | ||
7 | |||
6 | 8 | ||
7 | struct sched_param { | 9 | struct sched_param { |
8 | int sched_priority; | 10 | int sched_priority; |
diff --git a/include/linux/sched/prio.h b/include/linux/sched/prio.h new file mode 100644 index 000000000000..9382ba84d5d0 --- /dev/null +++ b/include/linux/sched/prio.h | |||
@@ -0,0 +1,23 @@ | |||
1 | #ifndef _SCHED_PRIO_H | ||
2 | #define _SCHED_PRIO_H | ||
3 | |||
4 | /* | ||
5 | * Priority of a process goes from 0..MAX_PRIO-1, valid RT | ||
6 | * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH | ||
7 | * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority | ||
8 | * values are inverted: lower p->prio value means higher priority. | ||
9 | * | ||
10 | * The MAX_USER_RT_PRIO value allows the actual maximum | ||
11 | * RT priority to be separate from the value exported to | ||
12 | * user-space. This allows kernel threads to set their | ||
13 | * priority to a value higher than any user task. Note: | ||
14 | * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO. | ||
15 | */ | ||
16 | |||
17 | #define MAX_USER_RT_PRIO 100 | ||
18 | #define MAX_RT_PRIO MAX_USER_RT_PRIO | ||
19 | |||
20 | #define MAX_PRIO (MAX_RT_PRIO + 40) | ||
21 | #define DEFAULT_PRIO (MAX_RT_PRIO + 20) | ||
22 | |||
23 | #endif /* _SCHED_PRIO_H */ | ||
diff --git a/include/linux/sched/rt.h b/include/linux/sched/rt.h index 34e4ebea8fce..f7453d4c5613 100644 --- a/include/linux/sched/rt.h +++ b/include/linux/sched/rt.h | |||
@@ -1,24 +1,7 @@ | |||
1 | #ifndef _SCHED_RT_H | 1 | #ifndef _SCHED_RT_H |
2 | #define _SCHED_RT_H | 2 | #define _SCHED_RT_H |
3 | 3 | ||
4 | /* | 4 | #include <linux/sched/prio.h> |
5 | * Priority of a process goes from 0..MAX_PRIO-1, valid RT | ||
6 | * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH | ||
7 | * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority | ||
8 | * values are inverted: lower p->prio value means higher priority. | ||
9 | * | ||
10 | * The MAX_USER_RT_PRIO value allows the actual maximum | ||
11 | * RT priority to be separate from the value exported to | ||
12 | * user-space. This allows kernel threads to set their | ||
13 | * priority to a value higher than any user task. Note: | ||
14 | * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO. | ||
15 | */ | ||
16 | |||
17 | #define MAX_USER_RT_PRIO 100 | ||
18 | #define MAX_RT_PRIO MAX_USER_RT_PRIO | ||
19 | |||
20 | #define MAX_PRIO (MAX_RT_PRIO + 40) | ||
21 | #define DEFAULT_PRIO (MAX_RT_PRIO + 20) | ||
22 | 5 | ||
23 | static inline int rt_prio(int prio) | 6 | static inline int rt_prio(int prio) |
24 | { | 7 | { |