diff --git a/fs/splice.c b/fs/splice.c index 2bd82e2..3931ee0 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -1077,6 +1077,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out, return splice_write(pipe, out, ppos, len, flags); } +EXPORT_SYMBOL(do_splice_from); /* * Attempt to initiate a splice from a file to a pipe. diff --git a/kernel/sched.c b/kernel/sched.c index 8c9ab0a..aff95b6 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -873,6 +873,26 @@ static inline int task_current(struct rq *rq, struct task_struct *p) return rq->curr == p; } +/* + * Look for any tasks *anywhere* that are running nice 0 or better. We do + * this lockless for overhead reasons since the occasional wrong result + * is harmless. + */ +int above_background_load(void) +{ + struct task_struct *cpu_curr; + unsigned long cpu; + + for_each_online_cpu(cpu) { + cpu_curr = cpu_rq(cpu)->curr; + if (unlikely(!cpu_curr)) + continue; + if (PRIO_TO_NICE(cpu_curr->static_prio) < 1) + return 1; + } + return 0; +} + #ifndef __ARCH_WANT_UNLOCKED_CTXSW static inline int task_running(struct rq *rq, struct task_struct *p) { diff --git a/mm/vmscan.c b/mm/vmscan.c index 858289f..e7664ac 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1677,8 +1677,10 @@ static int effective_sc_prio(struct task_struct *p) if (likely(p->mm)) { if (rt_task(p)) return -20; +#ifdef CONFIG_CPU_BFS if (p->policy == SCHED_IDLEPRIO) return 19; +#endif return task_nice(p); } return 0;