All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] loop: clear REQ_NOWAIT before workqueue submission
@ 2025-11-19  0:36 Chaitanya Kulkarni
  2025-11-19  0:36 ` [PATCH 2/2] zloop: " Chaitanya Kulkarni
  0 siblings, 1 reply; 4+ messages in thread
From: Chaitanya Kulkarni @ 2025-11-19  0:36 UTC (permalink / raw)
  To: axboe, dlemoal, hch; +Cc: linux-block, Chaitanya Kulkarni

loop advertises REQ_NOWAIT support via BLK_FEAT_NOWAIT (set by default
for all blk-mq devices), but delegates I/O processing to workqueues
where blocking operations are allowed.

Since REQ_NOWAIT is not valid in the workqueue context, clear the
REQ_NOWAIT flag before handing the request over to the workqueue. This
avoids unnecessary non-blocking constraints in a context where blocking
is acceptable.

Signed-off-by: Chaitanya Kulkarni <ckulkarnilinux@gmail.com>
---

Hi,

Patches are generated on base commit in linux-block/for-next :-

commit 6dbcc40ec7aa17ed3dd1f798e4201e75ab7d7447 (origin/for-next)
Merge: 58625d626327 ba13710ddd1f
Author: Jens Axboe <axboe@kernel.dk>
Date:   Wed Nov 5 18:24:17 2025 -0700

    Merge branch 'for-6.19/block' into for-next

    * for-6.19/block:
      rust: block: update ARef and AlwaysRefCounted imports from sync::aref

-ck

---
 drivers/block/loop.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 13ce229d450c..9d931ff456e7 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -797,6 +797,7 @@ static inline int queue_on_root_worker(struct cgroup_subsys_state *css)
 
 static void loop_queue_work(struct loop_device *lo, struct loop_cmd *cmd)
 {
+	struct request *rq = blk_mq_rq_from_pdu(cmd);
 	struct rb_node **node, *parent = NULL;
 	struct loop_worker *cur_worker, *worker = NULL;
 	struct work_struct *work;
@@ -860,6 +861,9 @@ static void loop_queue_work(struct loop_device *lo, struct loop_cmd *cmd)
 		work = &lo->rootcg_work;
 		cmd_list = &lo->rootcg_cmd_list;
 	}
+
+	rq->cmd_flags &= ~REQ_NOWAIT;
+
 	list_add_tail(&cmd->list_entry, cmd_list);
 	queue_work(lo->workqueue, work);
 	spin_unlock_irq(&lo->lo_work_lock);
-- 
2.40.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-11-19  5:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-19  0:36 [PATCH 1/2] loop: clear REQ_NOWAIT before workqueue submission Chaitanya Kulkarni
2025-11-19  0:36 ` [PATCH 2/2] zloop: " Chaitanya Kulkarni
2025-11-19  1:50   ` Damien Le Moal
2025-11-19  5:41     ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.