Loading include/linux/sched.h +5 −0 Original line number Diff line number Diff line Loading @@ -2481,6 +2481,7 @@ extern void do_set_cpus_allowed(struct task_struct *p, extern int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask); extern bool cpupri_check_rt(void); #else static inline void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) Loading @@ -2493,6 +2494,10 @@ static inline int set_cpus_allowed_ptr(struct task_struct *p, return -EINVAL; return 0; } static inline bool cpupri_check_rt(void) { return false; } #endif struct sched_load { Loading kernel/sched/cpupri.c +11 −0 Original line number Diff line number Diff line Loading @@ -279,3 +279,14 @@ void cpupri_cleanup(struct cpupri *cp) for (i = 0; i < CPUPRI_NR_PRIORITIES; i++) free_cpumask_var(cp->pri_to_cpu[i].mask); } /* * cpupri_check_rt - check if CPU has a RT task * should be called from rcu-sched read section. */ bool cpupri_check_rt(void) { int cpu = raw_smp_processor_id(); return cpu_rq(cpu)->rd->cpupri.cpu_to_pri[cpu] > CPUPRI_NORMAL; } kernel/softirq.c +4 −1 Original line number Diff line number Diff line Loading @@ -234,6 +234,8 @@ static inline bool lockdep_softirq_start(void) { return false; } static inline void lockdep_softirq_end(bool in_hardirq) { } #endif #define long_softirq_pending() (local_softirq_pending() & LONG_SOFTIRQ_MASK) #define defer_for_rt() (long_softirq_pending() && cpupri_check_rt()) asmlinkage __visible void __do_softirq(void) { unsigned long end = jiffies + MAX_SOFTIRQ_TIME; Loading Loading @@ -297,6 +299,7 @@ restart: pending = local_softirq_pending(); if (pending) { if (time_before(jiffies, end) && !need_resched() && !defer_for_rt() && --max_restart) goto restart; Loading Loading @@ -349,7 +352,7 @@ void irq_enter(void) static inline void invoke_softirq(void) { if (!force_irqthreads) { if (!force_irqthreads && !defer_for_rt()) { #ifdef CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK /* * We can safely execute softirq on the current stack if Loading Loading
include/linux/sched.h +5 −0 Original line number Diff line number Diff line Loading @@ -2481,6 +2481,7 @@ extern void do_set_cpus_allowed(struct task_struct *p, extern int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask); extern bool cpupri_check_rt(void); #else static inline void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask) Loading @@ -2493,6 +2494,10 @@ static inline int set_cpus_allowed_ptr(struct task_struct *p, return -EINVAL; return 0; } static inline bool cpupri_check_rt(void) { return false; } #endif struct sched_load { Loading
kernel/sched/cpupri.c +11 −0 Original line number Diff line number Diff line Loading @@ -279,3 +279,14 @@ void cpupri_cleanup(struct cpupri *cp) for (i = 0; i < CPUPRI_NR_PRIORITIES; i++) free_cpumask_var(cp->pri_to_cpu[i].mask); } /* * cpupri_check_rt - check if CPU has a RT task * should be called from rcu-sched read section. */ bool cpupri_check_rt(void) { int cpu = raw_smp_processor_id(); return cpu_rq(cpu)->rd->cpupri.cpu_to_pri[cpu] > CPUPRI_NORMAL; }
kernel/softirq.c +4 −1 Original line number Diff line number Diff line Loading @@ -234,6 +234,8 @@ static inline bool lockdep_softirq_start(void) { return false; } static inline void lockdep_softirq_end(bool in_hardirq) { } #endif #define long_softirq_pending() (local_softirq_pending() & LONG_SOFTIRQ_MASK) #define defer_for_rt() (long_softirq_pending() && cpupri_check_rt()) asmlinkage __visible void __do_softirq(void) { unsigned long end = jiffies + MAX_SOFTIRQ_TIME; Loading Loading @@ -297,6 +299,7 @@ restart: pending = local_softirq_pending(); if (pending) { if (time_before(jiffies, end) && !need_resched() && !defer_for_rt() && --max_restart) goto restart; Loading Loading @@ -349,7 +352,7 @@ void irq_enter(void) static inline void invoke_softirq(void) { if (!force_irqthreads) { if (!force_irqthreads && !defer_for_rt()) { #ifdef CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK /* * We can safely execute softirq on the current stack if Loading