dm writecache: skip writecache_wait for pmem mode
authorHuaisheng Ye <yehs1@lenovo.com>
Mon, 2 Sep 2019 10:04:50 +0000 (18:04 +0800)
committerMike Snitzer <snitzer@redhat.com>
Thu, 5 Sep 2019 17:22:05 +0000 (13:22 -0400)
The array bio_in_progress[2] only have chance to be increased and
decreased with ssd mode. For pmem mode, they are not involved at all.
So skip writecache_wait_for_ios in writecache_flush for pmem.

Suggested-by: Doris Yu <tyu1@lenovo.com>
Signed-off-by: Huaisheng Ye <yehs1@lenovo.com>
Acked-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-writecache.c

index c481947..d06b8aa 100644 (file)
@@ -726,7 +726,8 @@ static void writecache_flush(struct dm_writecache *wc)
        }
        writecache_commit_flushed(wc);
 
-       writecache_wait_for_ios(wc, WRITE);
+       if (!WC_MODE_PMEM(wc))
+               writecache_wait_for_ios(wc, WRITE);
 
        wc->seq_count++;
        pmem_assign(sb(wc)->seq_count, cpu_to_le64(wc->seq_count));