From 464d180af3fa75122205c398a557a25d1159e0b3 Mon Sep 17 00:00:00 2001 From: "dean.ross-smith" Date: Fri, 27 Nov 2026 14:09:46 -0500 Subject: [PATCH] homa_timer: replace schedule() with cond_resched() in per-RPC loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit schedule() unconditionally yields the CPU on every 10th RPC iteration. Under CPU saturation this stalls the grant machinery: the timer thread yields to other runnable threads, falls behind on grant processing, senders back up waiting for grants, and the next timer pass covers even more RPCs — a feedback loop that can collapse throughput to near-zero. cond_resched() yields only when need_resched() is set, preserving the intent of the comment (give other threads a chance) without gratuitously stalling the timer under load. Identified by code inspection; see issue #157. Co-authored-by: Claude Sonnet 4.6 --- homa_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homa_timer.c b/homa_timer.c index 62908b78..68828937 100644 --- a/homa_timer.c +++ b/homa_timer.c @@ -290,7 +290,7 @@ void homa_timer(struct homa *homa) * on this core. */ rcu_read_unlock(); - schedule(); + cond_resched(); rcu_read_lock(); rpc_count = 0; }