forked fromtorvalds/linux
- Notifications
You must be signed in to change notification settings - Fork0
Commitb7a3316
sched/fair: Add asymmetric CPU capacity wakeup scan
Issue=====On asymmetric CPU capacity topologies, we currently rely on wake_cap() todrive select_task_rq_fair() towards either:- its slow-path (find_idlest_cpu()) if either the previous or current (waking) CPU has too little capacity for the waking task- its fast-path (select_idle_sibling()) otherwiseCommit:3273163 ("sched/fair: Let asymmetric CPU configurations balance at wake-up")points out that this relies on the assumption that "[...]the CPU capacitieswithin an SD_SHARE_PKG_RESOURCES domain (sd_llc) are homogeneous".This assumption no longer holds on newer generations of big.LITTLEsystems (DynamIQ), which can accommodate CPUs of different compute capacitywithin a single LLC domain. To hopefully paint a better picture, a regularbig.LITTLE topology would look like this: +---------+ +---------+ | L2 | | L2 | +----+----+ +----+----+ |CPU0|CPU1| |CPU2|CPU3| +----+----+ +----+----+ ^^^ ^^^ LITTLEs bigswhich would result in the following scheduler topology: DIE [ ] <- sd_asym_cpucapacity MC [ ] [ ] <- sd_llc 0 1 2 3Conversely, a DynamIQ topology could look like: +-------------------+ | L3 | +----+----+----+----+ | L2 | L2 | L2 | L2 | +----+----+----+----+ |CPU0|CPU1|CPU2|CPU3| +----+----+----+----+ ^^^^^ ^^^^^ LITTLEs bigswhich would result in the following scheduler topology: MC [ ] <- sd_llc, sd_asym_cpucapacity 0 1 2 3What this means is that, on DynamIQ systems, we could pass the wake_cap()test (IOW presume the waking task fits on the CPU capacities of some LLCdomain), thus go through select_idle_sibling().This function operates on an LLC domain, which here spans both bigs andLITTLEs, so it could very well pick a CPU of too small capacity for thetask, despite there being fitting idle CPUs - it very much depends on theCPU iteration order, on which we have absolutely no guaranteescapacity-wise.Implementation==============Introduce yet another select_idle_sibling() helper function that takes CPUcapacity into account. The policy is to pick the first idle CPU which isbig enough for the task (task_util * margin < cpu_capacity). If noidle CPU is big enough, we pick the idle one with the highest capacity.Unlike other select_idle_sibling() helpers, this one operates on thesd_asym_cpucapacity sched_domain pointer, which is guaranteed to span allknown CPU capacities in the system. As such, this will work for both"legacy" big.LITTLE (LITTLEs & bigs split at MC, joined at DIE) and fornewer DynamIQ systems (e.g. LITTLEs and bigs in the same MC domain).Note that this limits the scope of select_idle_sibling() toselect_idle_capacity() for asymmetric CPU capacity systems - the LLC domainwill not be scanned, and no further heuristic will be applied.Signed-off-by: Morten Rasmussen <morten.rasmussen@arm.com>Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>Signed-off-by: Ingo Molnar <mingo@kernel.org>Signed-off-by: Thomas Gleixner <tglx@linutronix.de>Reviewed-by: Quentin Perret <qperret@google.com>Link:https://lkml.kernel.org/r/20200206191957.12325-2-valentin.schneider@arm.com1 parent82e0516 commitb7a3316
1 file changed
+56
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5896 | 5896 | | |
5897 | 5897 | | |
5898 | 5898 | | |
| 5899 | + | |
| 5900 | + | |
| 5901 | + | |
| 5902 | + | |
| 5903 | + | |
| 5904 | + | |
| 5905 | + | |
| 5906 | + | |
| 5907 | + | |
| 5908 | + | |
| 5909 | + | |
| 5910 | + | |
| 5911 | + | |
| 5912 | + | |
| 5913 | + | |
| 5914 | + | |
| 5915 | + | |
| 5916 | + | |
| 5917 | + | |
| 5918 | + | |
| 5919 | + | |
| 5920 | + | |
| 5921 | + | |
| 5922 | + | |
| 5923 | + | |
| 5924 | + | |
| 5925 | + | |
| 5926 | + | |
| 5927 | + | |
| 5928 | + | |
| 5929 | + | |
| 5930 | + | |
| 5931 | + | |
| 5932 | + | |
5899 | 5933 | | |
5900 | 5934 | | |
5901 | 5935 | | |
| |||
5904 | 5938 | | |
5905 | 5939 | | |
5906 | 5940 | | |
| 5941 | + | |
| 5942 | + | |
| 5943 | + | |
| 5944 | + | |
| 5945 | + | |
| 5946 | + | |
| 5947 | + | |
| 5948 | + | |
| 5949 | + | |
| 5950 | + | |
| 5951 | + | |
| 5952 | + | |
| 5953 | + | |
| 5954 | + | |
| 5955 | + | |
| 5956 | + | |
| 5957 | + | |
| 5958 | + | |
| 5959 | + | |
| 5960 | + | |
| 5961 | + | |
| 5962 | + | |
5907 | 5963 | | |
5908 | 5964 | | |
5909 | 5965 | | |
| |||
0 commit comments
Comments
(0)