All of lore.kernel.org
 help / color / mirror / Atom feed
* [dm-devel] [PATCH 0/1] dm writecache: commit just one block, not a full page
@ 2021-06-21 18:09 Mikulas Patocka
  2021-06-21 18:09 ` [dm-devel] [PATCH 1/1] " Mikulas Patocka
  0 siblings, 1 reply; 2+ messages in thread
From: Mikulas Patocka @ 2021-06-21 18:09 UTC (permalink / raw)
  To: Mikulas Patocka, dm-devel, msnitzer

Hi Mike

I suggest to remove the patch 991bd8d7bc78966b4dc427b53a144f276bffcd52
("dm writecache: commit just one block, not a full page") from your
repository and replace it with this patch.

Sub-4k writes have poor performance with most SSDs, so we should make sure
that we write at least 4k.

Mikulas

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


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

* [dm-devel] [PATCH 1/1] dm writecache: commit just one block, not a full page
  2021-06-21 18:09 [dm-devel] [PATCH 0/1] dm writecache: commit just one block, not a full page Mikulas Patocka
@ 2021-06-21 18:09 ` Mikulas Patocka
  0 siblings, 0 replies; 2+ messages in thread
From: Mikulas Patocka @ 2021-06-21 18:09 UTC (permalink / raw)
  To: Mikulas Patocka, dm-devel, msnitzer

Some architectures have pages larger than 4k and committing a full page
causes needless overhead.

Fix this by writing a single block when committing the superblock.

Writes smaller than 4k are slow on most SSDs (because the SSD performs
read-modify-write internally), so make sure that we write at least 4k.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

Index: linux-2.6/drivers/md/dm-writecache.c
===================================================================
--- linux-2.6.orig/drivers/md/dm-writecache.c
+++ linux-2.6/drivers/md/dm-writecache.c
@@ -532,7 +532,7 @@ static void ssd_commit_superblock(struct
 
 	region.bdev = wc->ssd_dev->bdev;
 	region.sector = 0;
-	region.count = PAGE_SIZE >> SECTOR_SHIFT;
+	region.count = max(4096U, wc->block_size) >> SECTOR_SHIFT;
 
 	if (unlikely(region.sector + region.count > wc->metadata_sectors))
 		region.count = wc->metadata_sectors - region.sector;

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


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

end of thread, other threads:[~2021-06-21 18:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21 18:09 [dm-devel] [PATCH 0/1] dm writecache: commit just one block, not a full page Mikulas Patocka
2021-06-21 18:09 ` [dm-devel] [PATCH 1/1] " Mikulas Patocka

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.