Re: [PATCH] scsi: ufs: core: move some irq handling back to hardirq (with time limit)
From: Bart Van Assche
Date: Thu Jul 24 2025 - 12:03:24 EST
On 7/24/25 2:54 AM, André Draszik wrote:
@@ -5656,19 +5689,39 @@ static int ufshcd_poll(struct Scsi_Host *shost, unsigned int queue_num)
WARN_ONCE(completed_reqs & ~hba->outstanding_reqs,
"completed: %#lx; outstanding: %#lx\n", completed_reqs,
hba->outstanding_reqs);
- if (queue_num == UFSHCD_POLL_FROM_INTERRUPT_CONTEXT) {
- /* Do not complete polled requests from interrupt context. */
+ if (time_limit) {
+ /* Do not complete polled requests from hardirq context. */
ufshcd_clear_polled(hba, &completed_reqs);
}
This if-statement and the code inside the if-statement probably can be
left out. This if-statement was introduced at a time when the block
layer did not support completing polled requests from interrupt context.
I think that commit b99182c501c3 ("bio: add pcpu caching for non-polling
bio_put") enabled support for completing polled requests from interrupt
context. Since this patch touches that if-statement, how about removing
it with a separate patch that comes before this patch? Polling can be
enabled by adding --hipri=1 to the fio command line and by using an I/O
engine that supports polling, e.g. pvsync2 or io_uring.
Thanks,
Bart.