All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] dm-bufio: improve the performance of __dm_bufio_prefetch
@ 2025-04-02  7:09 LongPing Wei
  2025-04-02  7:09 ` [PATCH 2/2] dm-verity: prefetch all hash blocks in verity_ctr LongPing Wei
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: LongPing Wei @ 2025-04-02  7:09 UTC (permalink / raw)
  To: snitzer, mpatocka
  Cc: dm-devel, guoweichao, ebiggers, bvanassche, LongPing Wei

1. call blk_flush_plug when cache hit as the address of the subsequent
 bio is no longer contiguous with the previous bio;
2. skip cond_resched when ioprio class is rt;

Signed-off-by: LongPing Wei <weilongping@oppo.com>
---
 drivers/md/dm-bufio.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index 9c8ed65cd87e..ec8392fbcf5d 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -1981,6 +1981,7 @@ static void __dm_bufio_prefetch(struct dm_bufio_client *c,
 			unsigned short ioprio)
 {
 	struct blk_plug plug;
+	unsigned short ioprio_class = IOPRIO_PRIO_CLASS(ioprio);
 
 	LIST_HEAD(write_list);
 
@@ -1997,6 +1998,7 @@ static void __dm_bufio_prefetch(struct dm_bufio_client *c,
 		if (b) {
 			/* already in cache */
 			cache_put_and_wake(c, b);
+			blk_flush_plug(&plug, false);
 			continue;
 		}
 
@@ -2017,7 +2019,8 @@ static void __dm_bufio_prefetch(struct dm_bufio_client *c,
 				submit_io(b, REQ_OP_READ, ioprio, read_endio);
 			dm_bufio_release(b);
 
-			cond_resched();
+			if (ioprio_class != IOPRIO_CLASS_RT)
+				cond_resched();
 
 			if (!n_blocks)
 				goto flush_plug;
-- 
2.34.1


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

end of thread, other threads:[~2025-04-10  8:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-02  7:09 [PATCH 1/2] dm-bufio: improve the performance of __dm_bufio_prefetch LongPing Wei
2025-04-02  7:09 ` [PATCH 2/2] dm-verity: prefetch all hash blocks in verity_ctr LongPing Wei
2025-04-02  9:56   ` Mikulas Patocka
2025-04-02 10:35     ` LongPing Wei
2025-04-02 18:44       ` Mikulas Patocka
2025-04-02 23:58         ` LongPing Wei
2025-04-10  8:28         ` Christoph Hellwig
2025-04-10  8:26   ` Christoph Hellwig
2025-04-02 17:43 ` [PATCH 1/2] dm-bufio: improve the performance of __dm_bufio_prefetch Eric Biggers
2025-04-03  0:12   ` LongPing Wei
2025-04-10  8:29 ` 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.