Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions scheds/experimental/scx_flow/src/bpf/fair.bpf.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,8 @@ static __always_inline void flow_run_recalc(struct flow_task_ctx *t)
if (!t)
return;
__sync_fetch_and_add(&m_ewma_fold, 1ULL);
/* Keep each run-history access at a fixed offset for the verifier. */
#pragma unroll
for (i = 0; i < 8; i++) {
u64 d = READ_ONCE(t->run_dur[i]);
u64 s = READ_ONCE(t->run_stamp[i]);
Expand Down
6 changes: 4 additions & 2 deletions scheds/rust/scx_pandemonium/src/bpf/main.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,7 @@ static __always_inline u64 keep_own_bound_ns(void)
// STATIC SCAN CEILING FOR THE SPILL HELPER ONLY. THE RUNTIME BUDGET ABOVE IS
// SMALL (6 AT 12C, 16 AT 32C), SO THE COMPILE-TIME BOUND IS PURE VERIFIER DEPTH.
// 32 COVERS EVERY REALISTIC TOPOLOGY -- NO SPILL WANTS THE 33RD-NEAREST SEAT --
// AND KEEPS THE INLINED select_cpu UNDER THE INSTRUCTION BUDGET. THE STEAL-SIDE
// AND LIMITS THE SIZE OF THE UNROLLED SPILL SCAN. THE STEAL-SIDE
// LOOPS KEEP THE FULL 128.
#define PCPU_SPILL_SCAN_MAX 32
// RETURNS THE NEAREST PEER IN src_cpu's CACHE DOMAIN THAT WOULD ADMIT A TASK BY
Expand All @@ -965,7 +965,8 @@ static __always_inline u64 keep_own_bound_ns(void)
// LINEAR R_eff TERM CANNOT SEPARATE THE TWO NON-SMT RUNGS (STANDING,
// do-not-re-attempt). THE BOUND IS THE PARTITION domain_inter_dsq DRAINS BY, SO
// A SPILL NEVER CROSSES AN L3. A FOREIGN PEER IS SKIPPED WITHOUT COSTING BUDGET.
static __always_inline s32 find_spill_seat(s32 src_cpu,
/* Share one copy of the unrolled scan between placement paths. */
static __noinline s32 find_spill_seat(s32 src_cpu,
const struct cpumask *allowed,
u64 now)
{
Expand All @@ -977,6 +978,7 @@ static __always_inline s32 find_spill_seat(s32 src_cpu,
u32 src_dom = cpu_domain_of(src_cpu);
u32 checked = 0;

#pragma unroll
for (int i = 0; i < PCPU_SPILL_SCAN_MAX; i++) {
u32 key = base + (u32)i;
u32 *val = bpf_map_lookup_elem(&affinity_rank, &key);
Expand Down
Loading