From 751fcb656198e1a8001a131c4166c8f168df7f0c Mon Sep 17 00:00:00 2001 From: Aelin Reidel Date: Wed, 3 Jun 2026 13:31:44 +0200 Subject: [PATCH] perf(network): toggle polling mode conditionally Currently mostly an experiment. --- src/executor/network.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/executor/network.rs b/src/executor/network.rs index d30f648bd3..ff10881647 100644 --- a/src/executor/network.rs +++ b/src/executor/network.rs @@ -249,7 +249,17 @@ async fn network_run() { match nic.poll_common(now) { PollResult::SocketStateChanged => { // Progress was made + // This will result in the task getting polled again the next + // time the kernel is entered cx.waker().wake_by_ref(); + // Enter polling mode temporarily + // FIXME: maybe not on every state change + nic.set_polling_mode(true); + // FIXME: Maybe use a different source + // Set a timer for 1 second to ensure we end up in the kernel + // again in the next second to poll the interface once + create_timer(Source::Network, 1000 * 1000); + trace!("Enabled polling mode and configured network interrupt for 1 second"); } PollResult::None => { // Very likely no progress can be made, so set up a timer interrupt to wake the waker