dm cache policy smq: ensure IO doesn't prevent cleaner policy progress
authorJoe Thornber <ejt@redhat.com>
Tue, 25 Jul 2023 15:44:41 +0000 (11:44 -0400)
committerMike Snitzer <snitzer@kernel.org>
Tue, 25 Jul 2023 15:55:50 +0000 (11:55 -0400)
commit1e4ab7b4c881cf26c1c72b3f56519e03475486fb
treebb08b4ac1c8e9afb9f44a195716239bdd73abc8b
parent7d5fff8982a2199d49ec067818af7d84d4f95ca0
dm cache policy smq: ensure IO doesn't prevent cleaner policy progress

When using the cleaner policy to decommission the cache, there is
never any writeback started from the cache as it is constantly delayed
due to normal I/O keeping the device busy. Meaning @idle=false was
always being passed to clean_target_met()

Fix this by adding a specific 'cleaner' flag that is set when the
cleaner policy is configured. This flag serves to always allow the
cleaner's writeback work to be queued until the cache is
decommissioned (even if the cache isn't idle).

Reported-by: David Jeffery <djeffery@redhat.com>
Fixes: b29d4986d0da ("dm cache: significant rework to leverage dm-bio-prison-v2")
Cc: stable@vger.kernel.org
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
drivers/md/dm-cache-policy-smq.c