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>
This commit is contained in:
Joe Thornber
2015-05-15 15:20:09 +01:00
committed by Mike Snitzer
parent 066dbaa386
commit 20f6814b94
5 changed files with 13 additions and 7 deletions

View File

@@ -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;