[PATCH 1/2] dm-bufio: improve the performance of __dm_bufio_prefetch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
---
 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





[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux