Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sched/rt: Move rt specific bits into new header file

Move rt scheduler definitions out of include/linux/sched.h into
new file include/linux/sched/rt.h

Signed-off-by: Clark Williams <williams@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/20130207094707.7b9f825f@riff.lan
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Clark Williams and committed by
Ingo Molnar
8bd75c77 ce0dbbbb

+81 -57
+1 -1
drivers/spi/spi.c
··· 33 33 #include <linux/of_gpio.h> 34 34 #include <linux/pm_runtime.h> 35 35 #include <linux/export.h> 36 - #include <linux/sched.h> 36 + #include <linux/sched/rt.h> 37 37 #include <linux/delay.h> 38 38 #include <linux/kthread.h> 39 39 #include <linux/ioport.h>
+1 -1
drivers/staging/csr/bh.c
··· 15 15 */ 16 16 #include "csr_wifi_hip_unifi.h" 17 17 #include "unifi_priv.h" 18 - 18 + #include <linux/sched/rt.h> 19 19 20 20 /* 21 21 * ---------------------------------------------------------------------------
+1 -1
drivers/staging/csr/unifi_sme.c
··· 15 15 #include "unifi_priv.h" 16 16 #include "csr_wifi_hip_unifi.h" 17 17 #include "csr_wifi_hip_conversions.h" 18 - 18 + #include <linux/sched/rt.h> 19 19 20 20 21 21
+1
drivers/tty/sysrq.c
··· 15 15 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 16 16 17 17 #include <linux/sched.h> 18 + #include <linux/sched/rt.h> 18 19 #include <linux/interrupt.h> 19 20 #include <linux/mm.h> 20 21 #include <linux/fs.h>
+1
fs/select.c
··· 26 26 #include <linux/fs.h> 27 27 #include <linux/rcupdate.h> 28 28 #include <linux/hrtimer.h> 29 + #include <linux/sched/rt.h> 29 30 30 31 #include <asm/uaccess.h> 31 32
+2 -53
include/linux/sched.h
··· 1164 1164 /* rq "owned" by this entity/group: */ 1165 1165 struct cfs_rq *my_q; 1166 1166 #endif 1167 + 1167 1168 /* 1168 1169 * Load-tracking only depends on SMP, FAIR_GROUP_SCHED dependency below may be 1169 1170 * removed when useful for applications beyond shares distribution (e.g. ··· 1191 1190 struct rt_rq *my_q; 1192 1191 #endif 1193 1192 }; 1193 + 1194 1194 1195 1195 struct rcu_node; 1196 1196 ··· 1597 1595 { 1598 1596 } 1599 1597 #endif 1600 - 1601 - /* 1602 - * Priority of a process goes from 0..MAX_PRIO-1, valid RT 1603 - * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH 1604 - * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority 1605 - * values are inverted: lower p->prio value means higher priority. 1606 - * 1607 - * The MAX_USER_RT_PRIO value allows the actual maximum 1608 - * RT priority to be separate from the value exported to 1609 - * user-space. This allows kernel threads to set their 1610 - * priority to a value higher than any user task. Note: 1611 - * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO. 1612 - */ 1613 - 1614 - #define MAX_USER_RT_PRIO 100 1615 - #define MAX_RT_PRIO MAX_USER_RT_PRIO 1616 - 1617 - #define MAX_PRIO (MAX_RT_PRIO + 40) 1618 - #define DEFAULT_PRIO (MAX_RT_PRIO + 20) 1619 - 1620 - static inline int rt_prio(int prio) 1621 - { 1622 - if (unlikely(prio < MAX_RT_PRIO)) 1623 - return 1; 1624 - return 0; 1625 - } 1626 - 1627 - static inline int rt_task(struct task_struct *p) 1628 - { 1629 - return rt_prio(p->prio); 1630 - } 1631 1598 1632 1599 static inline struct pid *task_pid(struct task_struct *task) 1633 1600 { ··· 2023 2052 static inline void sched_autogroup_detach(struct task_struct *p) { } 2024 2053 static inline void sched_autogroup_fork(struct signal_struct *sig) { } 2025 2054 static inline void sched_autogroup_exit(struct signal_struct *sig) { } 2026 - #endif 2027 - 2028 - #ifdef CONFIG_RT_MUTEXES 2029 - extern int rt_mutex_getprio(struct task_struct *p); 2030 - extern void rt_mutex_setprio(struct task_struct *p, int prio); 2031 - extern void rt_mutex_adjust_pi(struct task_struct *p); 2032 - static inline bool tsk_is_pi_blocked(struct task_struct *tsk) 2033 - { 2034 - return tsk->pi_blocked_on != NULL; 2035 - } 2036 - #else 2037 - static inline int rt_mutex_getprio(struct task_struct *p) 2038 - { 2039 - return p->normal_prio; 2040 - } 2041 - # define rt_mutex_adjust_pi(p) do { } while (0) 2042 - static inline bool tsk_is_pi_blocked(struct task_struct *tsk) 2043 - { 2044 - return false; 2045 - } 2046 2055 #endif 2047 2056 2048 2057 extern bool yield_to(struct task_struct *p, bool preempt); ··· 2653 2702 2654 2703 extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask); 2655 2704 extern long sched_getaffinity(pid_t pid, struct cpumask *mask); 2656 - 2657 - extern void normalize_rt_tasks(void); 2658 2705 2659 2706 #ifdef CONFIG_CGROUP_SCHED 2660 2707
+58
include/linux/sched/rt.h
··· 1 + #ifndef _SCHED_RT_H 2 + #define _SCHED_RT_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 + static inline int rt_prio(int prio) 24 + { 25 + if (unlikely(prio < MAX_RT_PRIO)) 26 + return 1; 27 + return 0; 28 + } 29 + 30 + static inline int rt_task(struct task_struct *p) 31 + { 32 + return rt_prio(p->prio); 33 + } 34 + 35 + #ifdef CONFIG_RT_MUTEXES 36 + extern int rt_mutex_getprio(struct task_struct *p); 37 + extern void rt_mutex_setprio(struct task_struct *p, int prio); 38 + extern void rt_mutex_adjust_pi(struct task_struct *p); 39 + static inline bool tsk_is_pi_blocked(struct task_struct *tsk) 40 + { 41 + return tsk->pi_blocked_on != NULL; 42 + } 43 + #else 44 + static inline int rt_mutex_getprio(struct task_struct *p) 45 + { 46 + return p->normal_prio; 47 + } 48 + # define rt_mutex_adjust_pi(p) do { } while (0) 49 + static inline bool tsk_is_pi_blocked(struct task_struct *tsk) 50 + { 51 + return false; 52 + } 53 + #endif 54 + 55 + extern void normalize_rt_tasks(void); 56 + 57 + 58 + #endif /* _SCHED_RT_H */
+1
init/init_task.c
··· 3 3 #include <linux/mqueue.h> 4 4 #include <linux/sched.h> 5 5 #include <linux/sched/sysctl.h> 6 + #include <linux/sched/rt.h> 6 7 #include <linux/init.h> 7 8 #include <linux/fs.h> 8 9 #include <linux/mm.h>
+1
kernel/futex.c
··· 60 60 #include <linux/pid.h> 61 61 #include <linux/nsproxy.h> 62 62 #include <linux/ptrace.h> 63 + #include <linux/sched/rt.h> 63 64 64 65 #include <asm/futex.h> 65 66
+1
kernel/hrtimer.c
··· 45 45 #include <linux/debugobjects.h> 46 46 #include <linux/sched.h> 47 47 #include <linux/sched/sysctl.h> 48 + #include <linux/sched/rt.h> 48 49 #include <linux/timer.h> 49 50 50 51 #include <asm/uaccess.h>
+1
kernel/irq/manage.c
··· 16 16 #include <linux/interrupt.h> 17 17 #include <linux/slab.h> 18 18 #include <linux/sched.h> 19 + #include <linux/sched/rt.h> 19 20 #include <linux/task_work.h> 20 21 21 22 #include "internals.h"
+1
kernel/mutex.c
··· 19 19 */ 20 20 #include <linux/mutex.h> 21 21 #include <linux/sched.h> 22 + #include <linux/sched/rt.h> 22 23 #include <linux/export.h> 23 24 #include <linux/spinlock.h> 24 25 #include <linux/interrupt.h>
+1
kernel/rtmutex-debug.c
··· 17 17 * See rt.c in preempt-rt for proper credits and further information 18 18 */ 19 19 #include <linux/sched.h> 20 + #include <linux/sched/rt.h> 20 21 #include <linux/delay.h> 21 22 #include <linux/export.h> 22 23 #include <linux/spinlock.h>
+1
kernel/rtmutex-tester.c
··· 10 10 #include <linux/kthread.h> 11 11 #include <linux/export.h> 12 12 #include <linux/sched.h> 13 + #include <linux/sched/rt.h> 13 14 #include <linux/spinlock.h> 14 15 #include <linux/timer.h> 15 16 #include <linux/freezer.h>
+1
kernel/rtmutex.c
··· 13 13 #include <linux/spinlock.h> 14 14 #include <linux/export.h> 15 15 #include <linux/sched.h> 16 + #include <linux/sched/rt.h> 16 17 #include <linux/timer.h> 17 18 18 19 #include "rtmutex_common.h"
+2
kernel/sched/cpupri.c
··· 28 28 */ 29 29 30 30 #include <linux/gfp.h> 31 + #include <linux/sched.h> 32 + #include <linux/sched/rt.h> 31 33 #include "cpupri.h" 32 34 33 35 /* Convert between a 140 based task->prio, and our 102 based cpupri */
+1
kernel/sched/sched.h
··· 1 1 2 2 #include <linux/sched.h> 3 3 #include <linux/sched/sysctl.h> 4 + #include <linux/sched/rt.h> 4 5 #include <linux/mutex.h> 5 6 #include <linux/spinlock.h> 6 7 #include <linux/stop_machine.h>
+1
kernel/trace/trace.c
··· 39 39 #include <linux/poll.h> 40 40 #include <linux/nmi.h> 41 41 #include <linux/fs.h> 42 + #include <linux/sched/rt.h> 42 43 43 44 #include "trace.h" 44 45 #include "trace_output.h"
+1 -1
kernel/trace/trace_sched_wakeup.c
··· 15 15 #include <linux/kallsyms.h> 16 16 #include <linux/uaccess.h> 17 17 #include <linux/ftrace.h> 18 + #include <linux/sched/rt.h> 18 19 #include <trace/events/sched.h> 19 - 20 20 #include "trace.h" 21 21 22 22 static struct trace_array *wakeup_trace;
+1
kernel/watchdog.c
··· 23 23 #include <linux/module.h> 24 24 #include <linux/sysctl.h> 25 25 #include <linux/smpboot.h> 26 + #include <linux/sched/rt.h> 26 27 27 28 #include <asm/irq_regs.h> 28 29 #include <linux/kvm_para.h>
+1
mm/page-writeback.c
··· 35 35 #include <linux/buffer_head.h> /* __set_page_dirty_buffers */ 36 36 #include <linux/pagevec.h> 37 37 #include <linux/timer.h> 38 + #include <linux/sched/rt.h> 38 39 #include <trace/events/writeback.h> 39 40 40 41 /*
+1
mm/page_alloc.c
··· 58 58 #include <linux/prefetch.h> 59 59 #include <linux/migrate.h> 60 60 #include <linux/page-debug-flags.h> 61 + #include <linux/sched/rt.h> 61 62 62 63 #include <asm/tlbflush.h> 63 64 #include <asm/div64.h>