diff options
author | Joe Thornber <ejt@redhat.com> | 2015-05-15 16:20:09 +0200 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2015-05-29 20:19:04 +0200 |
commit | 20f6814b94fff4a98b123f1c2b691e936be27aaf (patch) | |
tree | 1845743b06f1a2e999a37c5ae98ba6649753a95a /drivers/md/dm-cache-target.c | |
parent | dm cache: track IO to the origin device using io_tracker (diff) | |
download | linux-20f6814b94fff4a98b123f1c2b691e936be27aaf.tar.xz linux-20f6814b94fff4a98b123f1c2b691e936be27aaf.zip |
dm cache: pass a new 'critical' flag to the policies when requesting writeback work
We only allow non critical writeback if the origin is idle. It is up
to the policy to decide what writeback work is critical.
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-cache-target.c')
-rw-r--r-- | drivers/md/dm-cache-target.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index 940c7b2b5ab4..5a9cd2c5a359 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c @@ -1787,6 +1787,7 @@ static void writeback_some_dirty_blocks(struct cache *cache) dm_cblock_t cblock; struct prealloc structs; struct dm_bio_prison_cell *old_ocell; + bool busy = !iot_idle_for(&cache->origin_tracker, HZ); memset(&structs, 0, sizeof(structs)); @@ -1794,7 +1795,7 @@ static void writeback_some_dirty_blocks(struct cache *cache) if (prealloc_data_structs(cache, &structs)) break; - r = policy_writeback_work(cache->policy, &oblock, &cblock); + r = policy_writeback_work(cache->policy, &oblock, &cblock, busy); if (r) break; |