Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1206552
| From | Byungchul Park <byungchul.park@lge.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] sched: sync with the cfs_rq when changing sched class |
| Date | 2015-08-13 09:20 +0200 |
| Message-ID | <pWUXU-4He-13@gated-at.bofh.it> (permalink) |
| References | <pWTIu-2Kb-9@gated-at.bofh.it> <pWUlb-3IA-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Aug 13, 2015 at 06:41:45AM +0800, Yuyang Du wrote: > On Thu, Aug 13, 2015 at 02:55:55PM +0900, byungchul.park@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 necessary, because > since last_update_time if it has ever been updated, the load has become > random, IOW, useless. So we simply leave it unattended, and let itself > merge in the system. hello, i agree with you almost. it would have a meaningless value over time, while it has a meaningful value as soon as it leaved that cfs_rq. however, IMHO, nobody know when a task is switched between sched classes. i think it would be better that we consider that load rather than leave it unattended, even though, of course, in both of cases __update_load_avg() will dacay and fix it over time. shouldn't we consider it? 1. case returning back to fair class very soon: original code cannot reflect the task load to cfs_rq, while patched code can reflect the task load to cfs_rq. 2. case returning back to fair class after long: original code adds 0 to cfs_rq and let __update_load_avg() fix it, while patched code adds a meaningless value to cfs_rq and let __update_load_avg() fix it, afterall these become same. > > > > > #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 * scale_load_down(se->load.weight), > > - cfs_rq->curr == se, NULL); > > - > > - /* remove our load when we leave */ > > - cfs_rq->avg.load_avg = max_t(long, cfs_rq->avg.load_avg - se->avg.load_avg, 0); > > - cfs_rq->avg.load_sum = max_t(s64, cfs_rq->avg.load_sum - se->avg.load_sum, 0); > > - cfs_rq->avg.util_avg = max_t(long, cfs_rq->avg.util_avg - se->avg.util_avg, 0); > > - cfs_rq->avg.util_sum = max_t(s32, cfs_rq->avg.util_sum - se->avg.util_sum, 0); > > + detach_entity_load_avg(cfs_rq, se); > > #endif > > You changed the logic. yes, i changed it. but i think that calling __update_load_avg() is not a problem even in case of "queued == 1". so i didn't think that change seriously. wrong? :( thanks, byungchul > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@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 linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] sched: sync with the cfs_rq when changing sched class byungchul.park@lge.com - 2015-08-13 08:00 +0200
Re: [PATCH] sched: sync with the cfs_rq when changing sched class Yuyang Du <yuyang.du@intel.com> - 2015-08-13 08:40 +0200
Re: [PATCH] sched: sync with the cfs_rq when changing sched class Byungchul Park <byungchul.park@lge.com> - 2015-08-13 09:20 +0200
Re: [PATCH] sched: sync with the cfs_rq when changing sched class Yuyang Du <yuyang.du@intel.com> - 2015-08-13 12:30 +0200
Re: [PATCH] sched: sync with the cfs_rq when changing sched class Peter Zijlstra <peterz@infradead.org> - 2015-08-13 09:50 +0200
Re: [PATCH] sched: sync with the cfs_rq when changing sched class Byungchul Park <byungchul.park@lge.com> - 2015-08-13 10:30 +0200
Re: [PATCH] sched: sync with the cfs_rq when changing sched class Yuyang Du <yuyang.du@intel.com> - 2015-08-13 12:10 +0200
Re: [PATCH] sched: sync with the cfs_rq when changing sched class Byungchul Park <byungchul.park@lge.com> - 2015-08-13 13:00 +0200
Re: [PATCH] sched: sync with the cfs_rq when changing sched class Peter Zijlstra <peterz@infradead.org> - 2015-08-13 17:30 +0200
Re: [PATCH] sched: sync with the cfs_rq when changing sched class Yuyang Du <yuyang.du@intel.com> - 2015-08-14 09:20 +0200
Re: [PATCH] sched: sync with the cfs_rq when changing sched class Peter Zijlstra <peterz@infradead.org> - 2015-08-14 10:50 +0200
Re: [PATCH] sched: sync with the cfs_rq when changing sched class Byungchul Park <byungchul.park@lge.com> - 2015-08-15 09:00 +0200
Re: [PATCH] sched: sync with the cfs_rq when changing sched class Byungchul Park <byungchul.park@lge.com> - 2015-08-15 09:20 +0200
Re: [PATCH] sched: sync with the cfs_rq when changing sched class Byungchul Park <byungchul.park@lge.com> - 2015-08-13 10:50 +0200
Re: [PATCH] sched: sync with the cfs_rq when changing sched class "T. Zhou" <t.s.zhou@hotmail.com> - 2015-08-14 15:20 +0200
Re: [PATCH] sched: sync with the cfs_rq when changing sched class Byungchul Park <byungchul.park@lge.com> - 2015-08-15 06:30 +0200
Re: [PATCH] sched: sync with the cfs_rq when changing sched class "T. Zhou" <t.s.zhou@hotmail.com> - 2015-08-15 14:50 +0200
csiph-web