Commit fcb7031
sched/fair: Attach sched_domain_shared to sd_asym_cpucapacity
BugLink: https://bugs.launchpad.net/bugs/2150671
On asymmetric CPU capacity systems, the wakeup path uses
select_idle_capacity(), which scans the span of sd_asym_cpucapacity
rather than sd_llc.
The has_idle_cores hint however lives on sd_llc->shared, so the
wakeup-time read of has_idle_cores operates on an LLC-scoped blob while
the actual scan/decision spans the wider asym domain; nr_busy_cpus also
lives in the same shared sched_domain data, but it's never used in the
asym CPU capacity scenario.
Therefore, move the sched_domain_shared object to sd_asym_cpucapacity
whenever the CPU has a SD_ASYM_CPUCAPACITY_FULL ancestor and that
ancestor is non-overlapping (i.e., not built from SD_NUMA). In that case
the scope of has_idle_cores matches the scope of the wakeup scan.
Fall back to attaching the shared object to sd_llc in three cases:
1) plain symmetric systems (no SD_ASYM_CPUCAPACITY_FULL anywhere);
2) CPUs in an exclusive cpuset that carves out a symmetric capacity
island: has_asym is system-wide but those CPUs have no
SD_ASYM_CPUCAPACITY_FULL ancestor in their hierarchy and follow
the symmetric LLC path in select_idle_sibling();
3) exotic topologies where SD_ASYM_CPUCAPACITY_FULL lands on an
SD_NUMA-built domain. init_sched_domain_shared() keys the shared
blob off cpumask_first(span), which on overlapping NUMA domains
would alias unrelated spans onto the same blob. Keep the shared
object on the LLC there; select_idle_capacity() gracefully skips
the has_idle_cores preference when sd->shared is NULL.
While at it, also rename the per-CPU sd_llc_shared to sd_balance_shared,
as it is no longer strictly tied to the LLC.
Co-developed-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Acked-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://patch.msgid.link/20260516055850.1345932-1-arighi@nvidia.com
(backported from fdfe5a8 linux-next)
[ arighi:
- backport full logic to attach sd->shared in build_sched_domains()
- do not rename sd_llc_shared to reduce the risk of conflicts ]
Signed-off-by: Andrea Righi <arighi@nvidia.com>
Acked-by: Seth Forshee <sforshee@nvidia.com>
Acked-by: Nirmoy Das <nirmoyd@nvidia.com>
Acked-by: Matthew R. Ochs <mochs@nvidia.com>
Signed-off-by: Seth Forshee <sforshee@nvidia.com>1 parent 77bb67d commit fcb7031
2 files changed
Lines changed: 90 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12663 | 12663 | | |
12664 | 12664 | | |
12665 | 12665 | | |
12666 | | - | |
| 12666 | + | |
| 12667 | + | |
12667 | 12668 | | |
12668 | 12669 | | |
12669 | 12670 | | |
| |||
12693 | 12694 | | |
12694 | 12695 | | |
12695 | 12696 | | |
12696 | | - | |
| 12697 | + | |
| 12698 | + | |
12697 | 12699 | | |
12698 | 12700 | | |
12699 | 12701 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
675 | 675 | | |
676 | 676 | | |
677 | 677 | | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
678 | 691 | | |
679 | 692 | | |
680 | 693 | | |
681 | 694 | | |
682 | | - | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
683 | 704 | | |
684 | 705 | | |
685 | 706 | | |
686 | 707 | | |
687 | 708 | | |
| 709 | + | |
688 | 710 | | |
689 | 711 | | |
690 | 712 | | |
| |||
703 | 725 | | |
704 | 726 | | |
705 | 727 | | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | 728 | | |
710 | 729 | | |
711 | 730 | | |
| |||
1628 | 1647 | | |
1629 | 1648 | | |
1630 | 1649 | | |
1631 | | - | |
| 1650 | + | |
1632 | 1651 | | |
1633 | 1652 | | |
1634 | 1653 | | |
1635 | 1654 | | |
1636 | 1655 | | |
1637 | | - | |
1638 | 1656 | | |
1639 | 1657 | | |
1640 | 1658 | | |
| |||
1713 | 1731 | | |
1714 | 1732 | | |
1715 | 1733 | | |
1716 | | - | |
1717 | | - | |
1718 | | - | |
1719 | | - | |
1720 | | - | |
1721 | | - | |
1722 | | - | |
1723 | | - | |
1724 | | - | |
1725 | | - | |
1726 | 1734 | | |
1727 | 1735 | | |
1728 | 1736 | | |
| |||
2477 | 2485 | | |
2478 | 2486 | | |
2479 | 2487 | | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
| 2491 | + | |
| 2492 | + | |
| 2493 | + | |
| 2494 | + | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
2480 | 2498 | | |
2481 | 2499 | | |
2482 | 2500 | | |
| |||
2534 | 2552 | | |
2535 | 2553 | | |
2536 | 2554 | | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
| 2566 | + | |
| 2567 | + | |
| 2568 | + | |
| 2569 | + | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
2537 | 2607 | | |
2538 | 2608 | | |
2539 | 2609 | | |
| |||
0 commit comments