Commit be61197
committed
NVIDIA: SAUCE: sched/fair: Host has_idle_cores/nr_busy_cpus on sd_asym_cpucapacity
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. Idle cores in a
sibling LLC inside the asym span are therefore invisible to the hint;
nr_busy_cpus lives in the same shared sched_domain data, but it's never
used in the asym CPU capacity case.
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.
On for-6.17, sched_domain_shared is still wired in a post-pass after sched
groups are built (init_sched_domain_shared() uses sd->private), not from
sd_init(), matching this branch's topology build path.
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>
(backported from https://lore.kernel.org/all/20260428051720.3180182-1-arighi@nvidia.com)
[ arighi: backport full logic to attach sd->shared in build_sched_domains() ]
Signed-off-by: Andrea Righi <arighi@nvidia.com>1 parent 93e1b6a commit be61197
2 files changed
Lines changed: 90 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12347 | 12347 | | |
12348 | 12348 | | |
12349 | 12349 | | |
12350 | | - | |
| 12350 | + | |
| 12351 | + | |
12351 | 12352 | | |
12352 | 12353 | | |
12353 | 12354 | | |
| |||
12377 | 12378 | | |
12378 | 12379 | | |
12379 | 12380 | | |
12380 | | - | |
| 12381 | + | |
| 12382 | + | |
12381 | 12383 | | |
12382 | 12384 | | |
12383 | 12385 | | |
| |||
| 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 | + | |
| 710 | + | |
688 | 711 | | |
689 | 712 | | |
690 | 713 | | |
| |||
703 | 726 | | |
704 | 727 | | |
705 | 728 | | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | 729 | | |
710 | 730 | | |
711 | 731 | | |
| |||
1628 | 1648 | | |
1629 | 1649 | | |
1630 | 1650 | | |
1631 | | - | |
| 1651 | + | |
1632 | 1652 | | |
1633 | 1653 | | |
1634 | 1654 | | |
| |||
1670 | 1690 | | |
1671 | 1691 | | |
1672 | 1692 | | |
1673 | | - | |
1674 | 1693 | | |
1675 | 1694 | | |
1676 | 1695 | | |
| |||
1709 | 1728 | | |
1710 | 1729 | | |
1711 | 1730 | | |
1712 | | - | |
1713 | | - | |
1714 | | - | |
1715 | | - | |
1716 | | - | |
1717 | | - | |
1718 | | - | |
1719 | | - | |
1720 | | - | |
1721 | | - | |
1722 | 1731 | | |
1723 | 1732 | | |
1724 | 1733 | | |
| |||
2428 | 2437 | | |
2429 | 2438 | | |
2430 | 2439 | | |
| 2440 | + | |
| 2441 | + | |
| 2442 | + | |
| 2443 | + | |
| 2444 | + | |
| 2445 | + | |
| 2446 | + | |
| 2447 | + | |
| 2448 | + | |
| 2449 | + | |
2431 | 2450 | | |
2432 | 2451 | | |
2433 | 2452 | | |
| |||
2485 | 2504 | | |
2486 | 2505 | | |
2487 | 2506 | | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
| 2512 | + | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
2488 | 2558 | | |
2489 | 2559 | | |
2490 | 2560 | | |
| |||
0 commit comments