[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210706111827.2060499-91-sashal@kernel.org>
Date: Tue, 6 Jul 2021 07:17:17 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Mikulas Patocka <mpatocka@...hat.com>,
Mike Snitzer <snitzer@...hat.com>,
Sasha Levin <sashal@...nel.org>, dm-devel@...hat.com
Subject: [PATCH AUTOSEL 5.12 091/160] dm writecache: commit just one block, not a full page
From: Mikulas Patocka <mpatocka@...hat.com>
[ Upstream commit 991bd8d7bc78966b4dc427b53a144f276bffcd52 ]
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@...hat.com>
Signed-off-by: Mike Snitzer <snitzer@...hat.com>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/md/dm-writecache.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
index 7bb4d83e90cc..51b26db56ba9 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;
--
2.30.2
Powered by blists - more mailing lists