On Thu, 2008-05-22 at 14:09 +0200, Mike Galbraith wrote:Yeah, something like so - or perhaps like you say cache the wakee. I picked the wake_affine() condition, because I think that is the biggest factor in this behaviour. You could of course also disable all of sync. diff --git a/include/linux/sched.h b/include/linux/sched.h index c86c5c5..856c2a8 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -950,6 +950,8 @@ struct sched_entity { u64 last_wakeup; u64 avg_overlap; + struct sched_entity *waker; + #ifdef CONFIG_SCHEDSTATS u64 wait_start; u64 wait_max; diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 894a702..8971044 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -1036,7 +1036,8 @@ wake_affine(struct rq *rq, struct sched_domain *this_sd, struct rq *this_rq, * a reasonable amount of time then attract this newly * woken task: */ - if (sync && curr->sched_class == &fair_sched_class) { + if (sync && curr->sched_class == &fair_sched_class && + p->se.waker == curr->se->waker) { if (curr->se.avg_overlap < sysctl_sched_migration_cost && p->se.avg_overlap < sysctl_sched_migration_cost) return 1; @@ -1210,6 +1211,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p) if (unlikely(se == pse)) return; + se->waker = pse; cfs_rq_of(pse)->next = pse; /* --
| Greg Kroah-Hartman | [PATCH 006/196] Chinese: add translation of oops-tracing.txt |
| Jan Engelhardt | intel iommu (Re: -mm merge plans for 2.6.23) |
| James Bottomley | Re: Integration of SCST in the mainstream Linux kernel |
| Borislav Petkov | 2.6.23-rc1: no setup signature found... |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | Re: [BUG] New Kernel Bugs |
