From: Alfred Chen Subject: [PATCH] [BFS] Remove runqueue wake_list. The runqueue wake_list is used in ttwu_queue_remote(). In BFS, tasks are just put into grq, so wake_list is no needed. --- include/linux/sched.h | 5 +++ kernel/sched/bfs.c | 64 ----------------------------------------------- kernel/sched/bfs_sched.h | 4 -- 3 files changed, 5 insertions(+), 68 deletions(-) Index: linux-3.15.4-bfs/include/linux/sched.h =================================================================== --- linux-3.15.4-bfs.orig/include/linux/sched.h 2014-07-09 10:27:04.020174589 +0300 +++ linux-3.15.4-bfs/include/linux/sched.h 2014-07-09 10:39:58.495202170 +0300 @@ -2461,7 +2461,12 @@ extern char *get_task_comm(char *to, struct task_struct *tsk); #ifdef CONFIG_SMP +#ifdef CONFIG_SCHED_BFS +/* scheduler_ipi does nothing on BFS */ +static inline void scheduler_ipi(void) { } +#else void scheduler_ipi(void); +#endif extern unsigned long wait_task_inactive(struct task_struct *, long match_state); #else static inline void scheduler_ipi(void) { } Index: linux-3.15.4-bfs/kernel/sched/bfs.c =================================================================== --- linux-3.15.4-bfs.orig/kernel/sched/bfs.c 2014-07-09 10:27:04.541174608 +0300 +++ linux-3.15.4-bfs/kernel/sched/bfs.c 2014-07-09 10:43:38.978210022 +0300 @@ -1449,63 +1449,6 @@ wq_worker_waking_up(p, cpu_of(rq)); } -#ifdef CONFIG_SMP -static void -ttwu_do_activate(struct rq *rq, struct task_struct *p, int wake_flags) -{ - ttwu_activate(p, rq, false); - ttwu_post_activation(p, rq, true); -} - -static void sched_ttwu_pending(void) -{ - struct rq *rq = this_rq(); - struct llist_node *llist = llist_del_all(&rq->wake_list); - struct task_struct *p; - - grq_lock(); - - while (llist) { - p = llist_entry(llist, struct task_struct, wake_entry); - llist = llist_next(llist); - ttwu_do_activate(rq, p, 0); - } - - grq_unlock(); -} - -void scheduler_ipi(void) -{ - /* - * Fold TIF_NEED_RESCHED into the preempt_count; anybody setting - * TIF_NEED_RESCHED remotely (for the first time) will also send - * this IPI. - */ - preempt_fold_need_resched(); - - if (llist_empty(&this_rq()->wake_list)) - return; - - /* - * Not all reschedule IPI handlers call irq_enter/irq_exit, since - * traditionally all their work was done from the interrupt return - * path. Now that we actually do some work, we need to make sure - * we do call them. - * - * Some archs already do call them, luckily irq_enter/exit nest - * properly. - * - * Arguably we should visit all archs and update all handlers, - * however a fair share of IPIs are still resched only so this would - * somewhat pessimize the simple resched case. - */ - irq_enter(); - sched_ttwu_pending(); - - irq_exit(); -} -#endif /* CONFIG_SMP */ - /* * wake flags */ @@ -3735,12 +3678,6 @@ */ int idle_cpu(int cpu) { -#ifdef CONFIG_SMP - struct rq *rq = cpu_rq(cpu); - - if (!llist_empty(&rq->wake_list)) - return 0; -#endif return cpu_curr(cpu) == cpu_rq(cpu)->idle; } @@ -5457,7 +5394,6 @@ break; case CPU_DYING: - sched_ttwu_pending(); /* Update our root-domain */ grq_lock_irqsave(&flags); if (rq->rd) { Index: linux-3.15.4-bfs/kernel/sched/bfs_sched.h =================================================================== --- linux-3.15.4-bfs.orig/kernel/sched/bfs_sched.h 2014-07-09 10:27:04.314174600 +0300 +++ linux-3.15.4-bfs/kernel/sched/bfs_sched.h 2014-07-09 10:44:03.521210896 +0300 @@ -77,10 +77,6 @@ unsigned int ttwu_count; unsigned int ttwu_local; #endif /* CONFIG_SCHEDSTATS */ - -#ifdef CONFIG_SMP - struct llist_head wake_list; -#endif }; #ifdef CONFIG_SMP