sched/fair: Limit access to overutilized
Status from this message: The following commit has been merged into the sched/core branch of tip:
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest3 patches 9 repliesApplied
- v53 patches 3 repliesSuperseded
- v42 patches 9 repliesSuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 | 2 patches | 2 replies | Superseded | |
| v2 | 2 patches | 8 replies | Superseded | |
| v1 | 2 patches | 2 replies | Superseded |
Changes in v6 from the cover letter
- Mades minor changes for !CONFIG_SMP cases as pointed out by Vincent. v4 -> v5:
- Added EAS check inside helper functions instead of sprinkling it around. EAS check is static branch at best. So that keeps the code simpler.
- added EAS check inside cpu_overutilized as suggested by Qais.
- Added patch 3 since most of the code does eas && !overutilized pattern as suggested by Vincent.
Patches in v6 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | sched/fair: Add EAS checks before updating overutilizedkernel/ | +34 | 1 reply | |
| 2/3 | sched/fair: Use helper function to access rd->overutilizedkernel/ | +12 | 1 reply | |
| 3/3 | sched/fair: Combine EAS check with overutilized accesskernel/ | +9 | 6 replies |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Qais Yousef | Srikar Dronamraju | Vincent Guittot | Valentin Schneider |
|---|---|---|---|---|
| Series | R-b | |||
| 1/3 | R-b | R-b | R-b | |
| 2/3 | R-b | R-b | ||
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH v6 0/3] sched/fair: Limit access to overutilized
When running an ISV workload on a large system (240 Cores, SMT8), it was observed from perf profile that newidle_balance and enqueue_task_fair were consuming more cycles. Perf annotate showed that most of the time was spent on accessing overutilized field of root domain. Similar perf profile was simulated by making some changes to stress-ng --wait. Both newidle_balance and enqueue_task_fair consume close to 5-7%.
Overutilized was added for EAS(Energy aware scheduler) to decide whether to do load balance or not. Simultaneous access to overutilized by multiple CPUs lead cache invalidations due to true sharing. Updating overutilized is not required for non-EAS platforms. Since overutilized and overload are part of the same cacheline, there is false sharing as well.
Patch 1/3 - Main patch. It helps in reducing the above said issue. Both the functions don't show up in the profile. With patch comparison is in changelog. With the patch stated problem in the ISV workload also got solved and throughput has improved.
Patch 2/3 - Code refactoring to use the helper function instead of direct access of the field. Keeping this patch so patch 3/3 becomes easier to understand. Depends on 1/3.
Patch 3/3 - Refactoring the code since most of the patterns are observed are eas && !overutilzed. Changed the helper function accordingly. Depends on 2/3.
More details can be found in cover letter of v1.
v5 -> v6:
- Mades minor changes for !CONFIG_SMP cases as pointed out by Vincent. v4 -> v5:
- Added EAS check inside helper functions instead of sprinkling it around. EAS check is static branch at best. So that keeps the code simpler.
- added EAS check inside cpu_overutilized as suggested by Qais.
- Added patch 3 since most of the code does eas && !overutilized pattern as suggested by Vincent.
v3 -> v4:
- corrected a mistake where EAS check was missed.
v2 -> v3:
- Pierre and Dietmar suggested we could add one more EAS check before calling cpu_overutilized. That makes sense since that value is not used anyway in Non-EAS case.
- Refactored the code as dietmar suggested to avoid additional call to sched_energy_enabled().
- Minor edits to change log.
v1 -> v2:
Chen Yu pointed out minor issue in code. Corrected that code and updated the changelog.
v1: https://lore.kernel.org/lkml/[email protected]/
v2: https://lore.kernel.org/lkml/[email protected]/
v3: https://lore.kernel.org/lkml/[email protected]/
v4: https://lore.kernel.org/lkml/[email protected]/
v5: https://lore.kernel.org/lkml/[email protected]/
Shrikanth Hegde (3):
sched/fair: Add EAS checks before updating overutilized sched/fair: Use helper function to access rd->overutilized sched/fair: Combine EAS check with overutilized access
kernel/sched/fair.c | 72 ++++++++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 27 deletions(-)
--
2.39.3