summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-writecache.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2021-06-06 22:13:16 +0200
committerMike Snitzer <snitzer@redhat.com>2021-06-14 17:45:30 +0200
commit991bd8d7bc78966b4dc427b53a144f276bffcd52 (patch)
tree2aa4fcb0d1d5d83b9e63fcfd00b12a792089e5c4 /drivers/md/dm-writecache.c
parentdm writecache: remove unused gfp_t argument from wc_add_block() (diff)
downloadlinux-991bd8d7bc78966b4dc427b53a144f276bffcd52.tar.xz
linux-991bd8d7bc78966b4dc427b53a144f276bffcd52.zip
dm writecache: commit just one block, not a full page
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. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-writecache.c')
-rw-r--r--drivers/md/dm-writecache.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
index 01c3f51f4270..e18bbfd3289b 100644
--- a/drivers/md/dm-writecache.c
+++ b/drivers/md/dm-writecache.c
@@ -532,11 +532,7 @@ static void ssd_commit_superblock(struct dm_writecache *wc)
region.bdev = wc->ssd_dev->bdev;
region.sector = 0;
- region.count = PAGE_SIZE >> SECTOR_SHIFT;
-
- if (unlikely(region.sector + region.count > wc->metadata_sectors))
- region.count = wc->metadata_sectors - region.sector;
-
+ region.count = wc->block_size >> SECTOR_SHIFT;
region.sector += wc->start_sector;
req.bi_op = REQ_OP_WRITE;