summaryrefslogtreecommitdiff
path: root/drivers/md/dm-writecache.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2021-06-15 21:17:35 +0300
committerMike Snitzer <snitzer@redhat.com>2021-06-15 22:42:03 +0300
commit293128b1ef5ae2cfa7403d54e183fe689ed5d303 (patch)
treedd349a4d33751ae24bf01896197e05a72ec2ea49 /drivers/md/dm-writecache.c
parent8c77f1cb84585efba108df5e67ecc5cbbceef0d9 (diff)
downloadlinux-293128b1ef5ae2cfa7403d54e183fe689ed5d303.tar.xz
dm writecache: have ssd writeback wait if the kcopyd workqueue is busy
Make dm-writecache wait if the kcopyd workqueue is busy (as will happen if waiting for page allocation or inside submit_bio). This change improves performance of "mkfs.ext2" by approximately 20% on one testbed. 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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
index 56179a21db0e..28bb6890fcf4 100644
--- a/drivers/md/dm-writecache.c
+++ b/drivers/md/dm-writecache.c
@@ -1812,6 +1812,11 @@ static void writecache_writeback(struct work_struct *work)
struct writeback_list wbl;
unsigned long n_walked;
+ if (!WC_MODE_PMEM(wc)) {
+ /* Wait for any active kcopyd work on behalf of ssd writeback */
+ dm_kcopyd_client_flush(wc->dm_kcopyd);
+ }
+
wc_lock(wc);
restart:
if (writecache_has_error(wc)) {