diff options
| author | Robert Love <rml@tech9.net> | 2002-05-17 09:42:53 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-05-17 09:42:53 -0700 |
| commit | 33f18d46f2a61a15cf501cd2baab4c26583a84bc (patch) | |
| tree | a1acc302202394886e48a9143e2dff9ff8586e76 /include | |
| parent | 38b6083469278041932a844869c327f5456dbc93 (diff) | |
[PATCH] clean up maximum priorities
This patch further cleans up and separates the code in an effort to
allow setting (a) a larger maximum real-time priority than default and
(b) a maximum kernel RT priority that is separate than the maximum
priority exported to user-space.
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/init_task.h | 4 | ||||
| -rw-r--r-- | include/linux/sched.h | 17 |
2 files changed, 19 insertions, 2 deletions
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 98951775c267..4fcbad0862b8 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h @@ -45,8 +45,8 @@ thread_info: &init_thread_info, \ flags: 0, \ lock_depth: -1, \ - prio: 120, \ - static_prio: 120, \ + prio: MAX_PRIO-20, \ + static_prio: MAX_PRIO-20, \ policy: SCHED_OTHER, \ cpus_allowed: -1, \ mm: NULL, \ diff --git a/include/linux/sched.h b/include/linux/sched.h index 392d2174d84a..2ad9171a66b7 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -206,7 +206,24 @@ struct signal_struct { spinlock_t siglock; }; +/* + * Priority of a process goes from 0..MAX_PRIO-1, valid RT + * priority is 0..MAX_RT_PRIO-1, and SCHED_OTHER tasks are + * in the range MAX_RT_PRIO..MAX_PRIO-1. Priority values + * are inverted: lower p->prio value means higher priority. + * + * The MAX_RT_USER_PRIO value allows the actual maximum + * RT priority to be separate from the value exported to + * user-space. This allows kernel threads to set their + * priority to a value higher than any user task. Note: + * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO. + */ + +#define MAX_USER_RT_PRIO 100 +#define MAX_RT_PRIO MAX_USER_RT_PRIO +#define MAX_PRIO (MAX_RT_PRIO + 40) + /* * Some day this will be a full-fledged user tracking system.. */ |
