Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

[patch] sched: add the other missing clock update to migra..

 
   Soft32 Home -> Linux -> Kernel RSS
Next:  page allocation failures in mv643xx_eth_poll (was..  
Author Message
Mike Galbraith

External


Since: Nov 09, 2006
Posts: 232



(Msg. 1) Posted: Sun Nov 22, 2009 7:20 am
Post subject: [patch] sched: add the other missing clock update to migrate_task()
Archived from groups: linux>kernel (more info?)

sched: add the other missing clock update to migrate_task()

When calling set_task_cpu(), we must update both runqueue clocks in order
to get an accurate clock offset. Add it.


Signed-off-by: Mike Galbraith <efault.DeleteThis@gmx.de>
Cc: Ingo Molnar <mingo.DeleteThis@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra.DeleteThis@chello.nl>
LKML-Reference: <new-submission>

---
kernel/sched.c | 1 +
1 file changed, 1 insertion(+)

Index: linux-2.6/kernel/sched.c
===================================================================
--- linux-2.6.orig/kernel/sched.c
+++ linux-2.6/kernel/sched.c
@@ -2126,6 +2126,7 @@ migrate_task(struct task_struct *p, int
*/
if (!p->se.on_rq && !task_running(rq, p)) {
update_rq_clock(rq);
+ update_rq_clock(cpu_rq(dest_cpu));
set_task_cpu(p, dest_cpu);
return 0;
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.DeleteThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Login to vote
Peter Zijlstra

External


Since: Jun 06, 2007
Posts: 395



(Msg. 2) Posted: Sun Nov 22, 2009 7:20 am
Post subject: Re: [patch] sched: add the other missing clock update to migrate_task() [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sun, 2009-11-22 at 13:11 +0100, Mike Galbraith wrote:
> sched: add the other missing clock update to migrate_task()
>
> When calling set_task_cpu(), we must update both runqueue clocks in order
> to get an accurate clock offset. Add it.
>
>
> Signed-off-by: Mike Galbraith <efault.TakeThisOut@gmx.de>
> Cc: Ingo Molnar <mingo.TakeThisOut@elte.hu>
> Cc: Peter Zijlstra <a.p.zijlstra.TakeThisOut@chello.nl>
> LKML-Reference: <new-submission>
>
> ---
> kernel/sched.c | 1 +
> 1 file changed, 1 insertion(+)
>
> Index: linux-2.6/kernel/sched.c
> ===================================================================
> --- linux-2.6.orig/kernel/sched.c
> +++ linux-2.6/kernel/sched.c
> @@ -2126,6 +2126,7 @@ migrate_task(struct task_struct *p, int
> */
> if (!p->se.on_rq && !task_running(rq, p)) {
> update_rq_clock(rq);
> + update_rq_clock(cpu_rq(dest_cpu));
> set_task_cpu(p, dest_cpu);
> return 0;
> }


We should make double_rq_lock() and double_lock_balance() behave
equivalent wrt update_rq_clock().

Current, depending on CONFIG_PREEMPT, double_lock_balance() already
updates both rq clocks.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.TakeThisOut@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Login to vote
Mike Galbraith

External


Since: Nov 09, 2006
Posts: 232



(Msg. 3) Posted: Sun Nov 22, 2009 11:20 am
Post subject: Re: [patch] sched: add the other missing clock update to migrate_task() [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sun, 2009-11-22 at 14:16 +0100, Peter Zijlstra wrote:

> We should make double_rq_lock() and double_lock_balance() behave
> equivalent wrt update_rq_clock().
>
> Current, depending on CONFIG_PREEMPT, double_lock_balance() already
> updates both rq clocks.

Hm, right. Better plan. We can save an update in the wakeup path for
the tasks racing for the wakeup case too. If the call is really a
lock/unlock go away, we don't need to bother. Shave a ns or so.

-Mike

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.DeleteThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Login to vote
Mike Galbraith

External


Since: Nov 09, 2006
Posts: 232



(Msg. 4) Posted: Sun Nov 22, 2009 1:20 pm
Post subject: Re: [patch] sched: add the other missing clock update to migrate_task() [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sun, 2009-11-22 at 17:58 +0100, Mike Galbraith wrote:
> On Sun, 2009-11-22 at 14:16 +0100, Peter Zijlstra wrote:
>
> > We should make double_rq_lock() and double_lock_balance() behave
> > equivalent wrt update_rq_clock().
> >
> > Current, depending on CONFIG_PREEMPT, double_lock_balance() already
> > updates both rq clocks.
>
> Hm, right. Better plan.

Oops, nope. Consistency is still a good plan, however, that update is
still needed, because it's the case where we're _not_ going to use the
migration thread.

-Mike

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo.DeleteThis@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top
Login to vote
Display posts from previous:   
Related Topics:
[PATCH 2/11] Sched clock paravirt op - diff -r 3e746c0ebcdf arch/i386/kernel/paravirt.c --- a/arch/i386/kernel/paravirt.c Fri Feb 02 13:54:53 2007 -0800 +++..

[patch] sched: make cpu_clock() not use the rq clock - Subject: sched: make cpu_clock() not use the rq clock From: Ingo Molnar <mingo@elte.hu> it is enough to disable....

[PATCH 2/9] Sched clock paravirt op fix.patch - The custom_sched_clock hook is broken. The result from sched_clock needs to be in nanoseconds, not in CPU cycles. The...

[PATCH] Documentation update sched-stat.txt - While learning about schedstats I found that the documentation in the tree is old. I updated it and found some..

[PATCH] [RSDL-mm 4/6] sched: implement 180 bit sched bitmap - Modify the sched_find_first_bit function to work on a 180bit long bitmap. Signed-off-by: Con Kolivas..

[PATCH][RSDL-mm 4/6] sched implement 180 bit sched bitmap - From: Con Kolivas <kernel@kolivas.org> Modify the sched_find_first_bit function to work on a 180bit long bitmap....
       Soft32 Home -> Linux -> Kernel All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]