Skip to content

Mute CQEs of send/write to reduce wakeups #1264

@pyhd

Description

@pyhd

wait_timeout(nr) is generally a good way to reduce wakeups from kernel, while CQEs of send/write can bring unnecessary "noise", especially from plenty of zero-copy. In essence, it is difficult to estimate when send/write will return, yet their CQEs are generally not latency sensitive. So I think a possible solution is to flag MUTE_SUCCESS in the SQE, then its CQE will not be counted as wakeable.

if (sq_ready) {
    submit_and_wait_timeout(nr, 1ms);
} else {
    if (inflight_sends)
        wait_timeout(1, 100ms);  // even if no wakeup CQEs, muted CQEs will still be reaped in a poll way.
    else
        wait(1); // if no pending send/write CQEs
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions