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_en

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 sw

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

2015-08-14 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 mea

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_

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; > + cfs_r

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 con

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 lea

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 lea

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, s

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 > c

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

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

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) > - __update_load_avg

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 fa

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

2015-08-12 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