On Sat, 2007-09-22 at 12:01 +0200, Mike Galbraith wrote:Looking at a log (snippet attached) from this morning with the last hunk of your patch still intact, it looks like min_vruntime is being modified after a task is queued. If you look at the snippet, you'll see the nice 19 bash busy loop on CPU1 with a vruntime of 3010385.345325, and one second later on CPU1 with it's vruntime at 2814952.425082, but min_vruntime is 3061874.838356. I took a hammer to it, and my latencies running this test went away. diff -uprNX /root/dontdiff git/linux-2.6.sched-devel/kernel/sched_fair.c linux-2.6.23-rc7.d/kernel/sched_fair.c --- git/linux-2.6.sched-devel/kernel/sched_fair.c 2007-09-22 13:37:32.000000000 +0200 +++ linux-2.6.23-rc7.d/kernel/sched_fair.c 2007-09-23 08:29:38.000000000 +0200 @@ -290,14 +290,19 @@ __update_curr(struct cfs_rq *cfs_rq, str static void sync_vruntime(struct cfs_rq *cfs_rq) { struct rq *rq; - int cpu; + int cpu, wrote = 0; for_each_online_cpu(cpu) { rq = &per_cpu(runqueues, cpu); + if (spin_is_locked(&rq->lock)) + continue; + smp_wmb(); cfs_rq->min_vruntime = max_vruntime(cfs_rq->min_vruntime, rq->cfs.min_vruntime); + wrote++; } - schedstat_inc(cfs_rq, nr_sync_min_vruntime); + if (wrote) + schedstat_inc(cfs_rq, nr_sync_min_vruntime); } static void update_curr(struct cfs_rq *cfs_rq) @@ -306,8 +311,10 @@ static void update_curr(struct cfs_rq *c u64 now = rq_of(cfs_rq)->clock; unsigned long delta_exec; - if (unlikely(!curr)) + if (unlikely(!cfs_rq->nr_running)) return sync_vruntime(cfs_rq); + if (unlikely(!curr)) + return; /* * Get the amount of time the current task was running
| Andrew Morton | -mm merge plans for 2.6.23 |
| jjohansen | [AppArmor 39/45] AppArmor: Profile loading and manipulation, pathname matching |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| holzheu | Re: [RFC/PATCH] Documentation of kernel messages |
git: | |
| David Miller | Re: [BUG] New Kernel Bugs |
| Gerrit Renker | [PATCH 36/37] dccp: Initialisation and type-checking of feature sysctls |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
