linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 0/4] Utilization estimation (util_est) for FAIR tasks
@ 2018-03-09  9:52 Patrick Bellasi
  2018-03-09  9:52 ` [PATCH v6 1/4] sched/fair: add util_est on top of PELT Patrick Bellasi
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Patrick Bellasi @ 2018-03-09  9:52 UTC (permalink / raw)
  To: linux-kernel, linux-pm
  Cc: Ingo Molnar, Peter Zijlstra, Rafael J . Wysocki, Viresh Kumar,
	Vincent Guittot, Paul Turner, Dietmar Eggemann, Morten Rasmussen,
	Juri Lelli, Todd Kjos, Joel Fernandes, Steve Muckle

Hi, here is an update of [1], based on today's tip/sched/core [2], which mainly
adds some code cleanups suggested by Peter as well as fixes compilation for
!CONFIG_SMP systems.

Most notably:
a) The util_est's update flag has been renamed into UTIL_AVG_UNCHANGED, which
   seems to better match its usages.
b) The cpu_util_est() function has been removed to reduce cluttering by folding
   its code directly into cpu_util(). This last function is thus now always
   returning the estimated utilization of a CPU, unless this sched feature is
   disabled.
c) Not necessary READ_ONCE() have been removed from rq-lock protected code
   paths. For util_est variable, that we read/modify/write only from rq-lock
   protected, code we keep just the WRITE_ONCE() barriers, which are still
   required for synchronization with lockless readers.
   The READ_ONCE() have been instead maintained in all the getter functions,
   like for example task_util() and cpu_util(), which can potentially be used
   by lockless code. e.g. schedutil or load-balancer.

Results on both x86_64 and ARM (Android) targets, which have been collected and
reported in previous postings [1,3], show negligible overheads, especially
compared to the corresponding power/performance benefits on mobile platforms,
where this feature helps to reduce the performance gap between PELT and another
other out-of-tree load tracking solution.

Best,
Patrick


.:: Changelog
=============

Changes in v6:
 - remove READ_ONCE from rq-lock protected code paths
 - folds cpu_util_est code into cpu_util and update its documentation
 - change util_est's update flag name to better match its usage
 - slightly clean up cpu_util_wake code
 - add other small code cleanups as suggested by Peter
 - fix compilation for !CONFIG_SMP systems
 - fix documentation to match sphinx syntax
 - update changelogs to better match code concepts

Changes in v5:
 - rebased on today's tip/sched/core (commit 083c6eeab2cc, based on v4.16-rc2)
 - update util_est only on util_avg updates
 - add documentation for "struct util_est"
 - always use int instead of long whenever possible (Peter)
 - pass cfs_rq to util_est_{en,de}queue (Peter)
 - pass task_sleep to util_est_dequeue
 - use singe WRITE_ONCE at dequeue time
 - add some missing {READ,WRITE}_ONCE
 - add task_util_est() for code consistency

Changes in v4:
 - rebased on today's tip/sched/core (commit 460e8c3340a2)
 - renamed util_est's "last" into "enqueued"
 - using util_est's "enqueued" for both se and cfs_rqs (Joel)
 - update margin check to use more ASM friendly code (Peter)
 - optimize EWMA updates (Peter)
 - ensure cpu_util_wake() is cpu_capacity_orig()'s clamped (Pavan)
 - simplify cpu_util_cfs() integration (Dietmar)

Changes in v3:
 - rebased on today's tip/sched/core (commit 07881166a892)
 - moved util_est into sched_avg (Peter)
 - use {READ,WRITE}_ONCE() for EWMA updates (Peter)
 - using unsigned int to fit all sched_avg into a single 64B cache line
 - schedutil integration using Juri's cpu_util_cfs()
 - first patch dropped since it's already queued in tip/sched/core

Changes in v2:
 - rebased on top of v4.15-rc2
 - tested that overhauled PELT code does not affect the util_est


.:: References
==============
[1] https://lkml.org/lkml/2018/2/22/639
    20180222170153.673-1-patrick.bellasi@arm.com
[2] git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
    sched/core (commit 083c6eeab2cc)
[3] https://lkml.org/lkml/2018/1/23/645
    20180123180847.4477-1-patrick.bellasi@arm.com

Patrick Bellasi (4):
  sched/fair: add util_est on top of PELT
  sched/fair: use util_est in LB and WU paths
  sched/cpufreq_schedutil: use util_est for OPP selection
  sched/fair: update util_est only on util_avg updates

 include/linux/sched.h   |  29 ++++++
 kernel/sched/debug.c    |   4 +
 kernel/sched/fair.c     | 237 ++++++++++++++++++++++++++++++++++++++++++++----
 kernel/sched/features.h |   5 +
 kernel/sched/sched.h    |   9 +-
 5 files changed, 264 insertions(+), 20 deletions(-)

-- 
2.15.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-03-20 11:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-09  9:52 [PATCH v6 0/4] Utilization estimation (util_est) for FAIR tasks Patrick Bellasi
2018-03-09  9:52 ` [PATCH v6 1/4] sched/fair: add util_est on top of PELT Patrick Bellasi
2018-03-20 11:07   ` [tip:sched/core] sched/fair: Add " tip-bot for Patrick Bellasi
2018-03-09  9:52 ` [PATCH v6 2/4] sched/fair: use util_est in LB and WU paths Patrick Bellasi
2018-03-20 11:08   ` [tip:sched/core] sched/fair: Use " tip-bot for Patrick Bellasi
2018-03-09  9:52 ` [PATCH v6 3/4] sched/cpufreq_schedutil: use util_est for OPP selection Patrick Bellasi
2018-03-20 11:08   ` [tip:sched/core] sched/cpufreq/schedutil: Use " tip-bot for Patrick Bellasi
2018-03-09  9:52 ` [PATCH v6 4/4] sched/fair: update util_est only on util_avg updates Patrick Bellasi
2018-03-20 11:09   ` [tip:sched/core] sched/fair: Update " tip-bot for Patrick Bellasi
2018-03-16 13:25 ` [PATCH v6 0/4] Utilization estimation (util_est) for FAIR tasks Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).