Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-15 Thread T. Zhou
On Sat, Aug 15, 2015 at 01:24:12PM +0900, Byungchul Park wrote: > On Fri, Aug 14, 2015 at 08:59:02PM +0800, T. Zhou wrote: > > Hi, > > > > On Thu, Aug 13, 2015 at 02:55:55PM +0900, byungchul.p...@lge.com wrote: > > > +static void attach_entity_load_avg(struct cfs_rq *cfs_rq, struct > > >

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-15 Thread Byungchul Park
On Sat, Aug 15, 2015 at 03:52:48PM +0900, Byungchul Park wrote: > On Thu, Aug 13, 2015 at 05:22:12PM +0200, Peter Zijlstra wrote: > > On Thu, Aug 13, 2015 at 10:15:28AM +0800, Yuyang Du wrote: > > > On Thu, Aug 13, 2015 at 05:21:27PM +0900, Byungchul Park wrote: > > > > > > > > yuyang said that

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-15 Thread Byungchul Park
On Thu, Aug 13, 2015 at 05:22:12PM +0200, Peter Zijlstra wrote: > On Thu, Aug 13, 2015 at 10:15:28AM +0800, Yuyang Du wrote: > > On Thu, Aug 13, 2015 at 05:21:27PM +0900, Byungchul Park wrote: > > > > > > yuyang said that switched_to don't need to consider task's load because it > > > can have

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-15 Thread Byungchul Park
On Sat, Aug 15, 2015 at 03:52:48PM +0900, Byungchul Park wrote: On Thu, Aug 13, 2015 at 05:22:12PM +0200, Peter Zijlstra wrote: On Thu, Aug 13, 2015 at 10:15:28AM +0800, Yuyang Du wrote: On Thu, Aug 13, 2015 at 05:21:27PM +0900, Byungchul Park wrote: yuyang said that switched_to

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-15 Thread Byungchul Park
On Thu, Aug 13, 2015 at 05:22:12PM +0200, Peter Zijlstra wrote: On Thu, Aug 13, 2015 at 10:15:28AM +0800, Yuyang Du wrote: On Thu, Aug 13, 2015 at 05:21:27PM +0900, Byungchul Park wrote: yuyang said that switched_to don't need to consider task's load because it can have meaningless

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-15 Thread T. Zhou
On Sat, Aug 15, 2015 at 01:24:12PM +0900, Byungchul Park wrote: On Fri, Aug 14, 2015 at 08:59:02PM +0800, T. Zhou wrote: Hi, On Thu, Aug 13, 2015 at 02:55:55PM +0900, byungchul.p...@lge.com wrote: +static void attach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se)

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-14 Thread Byungchul Park
On Fri, Aug 14, 2015 at 08:59:02PM +0800, T. Zhou wrote: > Hi, > > On Thu, Aug 13, 2015 at 02:55:55PM +0900, byungchul.p...@lge.com wrote: > > +static void attach_entity_load_avg(struct cfs_rq *cfs_rq, struct > > sched_entity *se) > > +{ > > + se->avg.last_update_time =

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-14 Thread T. Zhou
Hi, On Thu, Aug 13, 2015 at 02:55:55PM +0900, byungchul.p...@lge.com wrote: > +static void attach_entity_load_avg(struct cfs_rq *cfs_rq, struct > sched_entity *se) > +{ > + se->avg.last_update_time = cfs_rq->avg.last_update_time; > + cfs_rq->avg.load_avg += se->avg.load_avg; > +

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-14 Thread Peter Zijlstra
On Fri, Aug 14, 2015 at 07:20:20AM +0800, Yuyang Du wrote: > sched: Provide sched class and priority change statistics to task > > The sched class and priority changes make substantial impact for > a task, but we really have not a quantitative understanding of how > frequent they are, which makes

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-14 Thread Yuyang Du
On Thu, Aug 13, 2015 at 05:22:12PM +0200, Peter Zijlstra wrote: > > when did I say "don't need to consider..."? > > > > Doing more does not mean better, or just trivial. BTW, the task switched_to > > does not have to be switched_from before. > > Correct, there's a few corner cases we need to

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-14 Thread Yuyang Du
On Thu, Aug 13, 2015 at 05:22:12PM +0200, Peter Zijlstra wrote: when did I say don't need to consider...? Doing more does not mean better, or just trivial. BTW, the task switched_to does not have to be switched_from before. Correct, there's a few corner cases we need to consider.

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-14 Thread Peter Zijlstra
On Fri, Aug 14, 2015 at 07:20:20AM +0800, Yuyang Du wrote: sched: Provide sched class and priority change statistics to task The sched class and priority changes make substantial impact for a task, but we really have not a quantitative understanding of how frequent they are, which makes it

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-14 Thread Byungchul Park
On Fri, Aug 14, 2015 at 08:59:02PM +0800, T. Zhou wrote: Hi, On Thu, Aug 13, 2015 at 02:55:55PM +0900, byungchul.p...@lge.com wrote: +static void attach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) +{ + se-avg.last_update_time = cfs_rq-avg.last_update_time; +

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-14 Thread T. Zhou
Hi, On Thu, Aug 13, 2015 at 02:55:55PM +0900, byungchul.p...@lge.com wrote: +static void attach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) +{ + se-avg.last_update_time = cfs_rq-avg.last_update_time; + cfs_rq-avg.load_avg += se-avg.load_avg; +

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-13 Thread Peter Zijlstra
On Thu, Aug 13, 2015 at 10:15:28AM +0800, Yuyang Du wrote: > On Thu, Aug 13, 2015 at 05:21:27PM +0900, Byungchul Park wrote: > > > > yuyang said that switched_to don't need to consider task's load because it > > can have meaningless value. but i think considering task's load is better > > than

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-13 Thread Byungchul Park
On Thu, Aug 13, 2015 at 10:15:28AM +0800, Yuyang Du wrote: > On Thu, Aug 13, 2015 at 05:21:27PM +0900, Byungchul Park wrote: > > > > yuyang said that switched_to don't need to consider task's load because it > > can have meaningless value. but i think considering task's load is better > > than

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-13 Thread Yuyang Du
On Thu, Aug 13, 2015 at 04:19:04PM +0900, Byungchul Park wrote: > > > #ifdef CONFIG_SMP > > > /* synchronize task with its prev cfs_rq */ > > > - if (!queued) > > > - __update_load_avg(cfs_rq->avg.last_update_time, > > > cpu_of(rq_of(cfs_rq)), > > > - >avg,

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-13 Thread Yuyang Du
On Thu, Aug 13, 2015 at 05:21:27PM +0900, Byungchul Park wrote: > > yuyang said that switched_to don't need to consider task's load because it > can have meaningless value. but i think considering task's load is better > than leaving it unattended at all. and we can also use switched_to if we >

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-13 Thread Byungchul Park
On Thu, Aug 13, 2015 at 09:46:00AM +0200, Peter Zijlstra wrote: > On Thu, Aug 13, 2015 at 02:55:55PM +0900, byungchul.p...@lge.com wrote: > > @@ -8023,16 +8036,7 @@ static void task_move_group_fair(struct task_struct > > *p, int queued) > > > > #ifdef CONFIG_SMP > > /* synchronize task

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-13 Thread Byungchul Park
On Thu, Aug 13, 2015 at 09:46:00AM +0200, Peter Zijlstra wrote: > On Thu, Aug 13, 2015 at 02:55:55PM +0900, byungchul.p...@lge.com wrote: > > @@ -8023,16 +8036,7 @@ static void task_move_group_fair(struct task_struct > > *p, int queued) > > > > #ifdef CONFIG_SMP > > /* synchronize task

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-13 Thread Peter Zijlstra
On Thu, Aug 13, 2015 at 02:55:55PM +0900, byungchul.p...@lge.com wrote: > @@ -8023,16 +8036,7 @@ static void task_move_group_fair(struct task_struct > *p, int queued) > > #ifdef CONFIG_SMP > /* synchronize task with its prev cfs_rq */ > - if (!queued) > -

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-13 Thread Byungchul Park
On Thu, Aug 13, 2015 at 06:41:45AM +0800, Yuyang Du wrote: > On Thu, Aug 13, 2015 at 02:55:55PM +0900, byungchul.p...@lge.com wrote: > > > > currently, a task load is synced with its cfs_rq, only when it > > leaves from fair class. we also need to sync it with cfs_rq when > > it returns back to

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-13 Thread Yuyang Du
On Thu, Aug 13, 2015 at 02:55:55PM +0900, byungchul.p...@lge.com wrote: > > currently, a task load is synced with its cfs_rq, only when it > leaves from fair class. we also need to sync it with cfs_rq when > it returns back to fair class, too. Syncing it at the time it is switched to fair is

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-13 Thread Byungchul Park
On Thu, Aug 13, 2015 at 09:46:00AM +0200, Peter Zijlstra wrote: On Thu, Aug 13, 2015 at 02:55:55PM +0900, byungchul.p...@lge.com wrote: @@ -8023,16 +8036,7 @@ static void task_move_group_fair(struct task_struct *p, int queued) #ifdef CONFIG_SMP /* synchronize task with its prev

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-13 Thread Byungchul Park
On Thu, Aug 13, 2015 at 09:46:00AM +0200, Peter Zijlstra wrote: On Thu, Aug 13, 2015 at 02:55:55PM +0900, byungchul.p...@lge.com wrote: @@ -8023,16 +8036,7 @@ static void task_move_group_fair(struct task_struct *p, int queued) #ifdef CONFIG_SMP /* synchronize task with its prev

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-13 Thread Yuyang Du
On Thu, Aug 13, 2015 at 02:55:55PM +0900, byungchul.p...@lge.com wrote: currently, a task load is synced with its cfs_rq, only when it leaves from fair class. we also need to sync it with cfs_rq when it returns back to fair class, too. Syncing it at the time it is switched to fair is not

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-13 Thread Peter Zijlstra
On Thu, Aug 13, 2015 at 02:55:55PM +0900, byungchul.p...@lge.com wrote: @@ -8023,16 +8036,7 @@ static void task_move_group_fair(struct task_struct *p, int queued) #ifdef CONFIG_SMP /* synchronize task with its prev cfs_rq */ - if (!queued) -

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-13 Thread Byungchul Park
On Thu, Aug 13, 2015 at 06:41:45AM +0800, Yuyang Du wrote: On Thu, Aug 13, 2015 at 02:55:55PM +0900, byungchul.p...@lge.com wrote: currently, a task load is synced with its cfs_rq, only when it leaves from fair class. we also need to sync it with cfs_rq when it returns back to fair

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-13 Thread Yuyang Du
On Thu, Aug 13, 2015 at 05:21:27PM +0900, Byungchul Park wrote: yuyang said that switched_to don't need to consider task's load because it can have meaningless value. but i think considering task's load is better than leaving it unattended at all. and we can also use switched_to if we

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-13 Thread Byungchul Park
On Thu, Aug 13, 2015 at 10:15:28AM +0800, Yuyang Du wrote: On Thu, Aug 13, 2015 at 05:21:27PM +0900, Byungchul Park wrote: yuyang said that switched_to don't need to consider task's load because it can have meaningless value. but i think considering task's load is better than leaving it

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-13 Thread Yuyang Du
On Thu, Aug 13, 2015 at 04:19:04PM +0900, Byungchul Park wrote: #ifdef CONFIG_SMP /* synchronize task with its prev cfs_rq */ - if (!queued) - __update_load_avg(cfs_rq-avg.last_update_time, cpu_of(rq_of(cfs_rq)), - se-avg, se-on_rq *

Re: [PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-13 Thread Peter Zijlstra
On Thu, Aug 13, 2015 at 10:15:28AM +0800, Yuyang Du wrote: On Thu, Aug 13, 2015 at 05:21:27PM +0900, Byungchul Park wrote: yuyang said that switched_to don't need to consider task's load because it can have meaningless value. but i think considering task's load is better than leaving it

[PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-12 Thread byungchul . park
17 00:00:00 2001 From: Byungchul Park Date: Thu, 13 Aug 2015 14:29:52 +0900 Subject: [PATCH] sched: sync with the cfs_rq when changing sched class currently, a task load is synced with its cfs_rq, only when it leaves from fair class. we also need to sync it with cfs_rq when it returns back to

[PATCH] sched: sync with the cfs_rq when changing sched class

2015-08-12 Thread byungchul . park
Sep 17 00:00:00 2001 From: Byungchul Park byungchul.p...@lge.com Date: Thu, 13 Aug 2015 14:29:52 +0900 Subject: [PATCH] sched: sync with the cfs_rq when changing sched class currently, a task load is synced with its cfs_rq, only when it leaves from fair class. we also need to sync it with cfs_rq when