Re: [PATCH v2 6/6] scsi: bsg: release io_uring requests in end-I/O

From: Bart Van Assche

Date: Mon Oct 26 2026 - 12:01:46 EST


On 10/26/26 1:29 AM, Yingjie Wang wrote:
+ pdu->response_addr = READ_ONCE(cmd->response);
+ pdu->max_response_len = min(READ_ONCE(cmd->max_response_len),
+ SCSI_SENSE_BUFFERSIZE);
+ pdu->sense_buffer = NULL;
+ if (pdu->response_addr && pdu->max_response_len) {
+ pdu->sense_buffer = kmalloc(pdu->max_response_len,
+ gfp_mask | __GFP_ACCOUNT);
+ if (!pdu->sense_buffer)
+ return (issue_flags & IO_URING_F_NONBLOCK) ? -EAGAIN : -ENOMEM;
+ }

No new kmalloc() calls in the I/O path please. These have a measurable
performance impact.

Thanks,

Bart.