[PATCH] dm zoned: update atime for new buffer zones

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

 



When a new buffer zone is allocated in dmz_handle_buffered_write()
we should update the 'atime' to inform reclaim that this zone has
been accessed.
Otherwise we end up with the pathological case where the first write
allocates a new buffer zone, but the next write will start reclaim
before processing the bio. As the atime is not set reclaim declares
the system idle and reclaims the zone. Then the write will be processed
and re-allocate the very same zone again; this repeats for every
consecutive write, making for a _very_ slow mkfs.

Signed-off-by: Hannes Reinecke <hare@xxxxxxx>
---
 drivers/md/dm-zoned-target.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/md/dm-zoned-target.c b/drivers/md/dm-zoned-target.c
index cf915009c306..b32d37bef14f 100644
--- a/drivers/md/dm-zoned-target.c
+++ b/drivers/md/dm-zoned-target.c
@@ -297,6 +297,9 @@ static int dmz_handle_buffered_write(struct dmz_target *dmz,
 	if (dmz_is_readonly(bzone))
 		return -EROFS;
 
+	/* Tell reclaim we're doing some work here */
+	dmz_reclaim_bio_acc(bzone->dev->reclaim);
+
 	/* Submit write */
 	ret = dmz_submit_bio(dmz, bzone, bio, chunk_block, nr_blocks);
 	if (ret)
-- 
2.16.4

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




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

  Powered by Linux