On 3/21/25 18:48, Caleb Sander Mateos wrote:
io_send_zc() guards its call to io_send_zc_import() with if (!done_io) in an attempt to avoid calling it redundantly on the same req. However, if the initial non-blocking issue returns -EAGAIN, done_io will stay 0. This causes the subsequent issue to unnecessarily re-import the buffer. Add an explicit flag "imported" to io_sr_msg to track if its buffer has already been imported. Clear the flag in io_send_zc_prep(). Call io_send_zc_import() and set the flag in io_send_zc() if it is unset.
lgtm. Maybe there is a way to put it into req->flags and combine with REQ_F_IMPORT_BUFFER, but likely just an idea for the future. -- Pavel Begunkov