diff options
author | Joe Thornber <ejt@redhat.com> | 2015-05-27 10:39:45 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2015-06-11 17:13:00 -0400 |
commit | 88bf5184fa5861e766e39fd34fc6d21557ac7be8 (patch) | |
tree | 5cbb1ffbcc0b8e7f648f2b65e93b834cb1a02b8b | |
parent | 66a636356647a9be8885c2ce2948de126577698a (diff) |
dm cache: wake the worker thread every time we free a migration object
When the cache is idle, writeback work was only being issued every
second. With this change outstanding writebacks are streamed
constantly. This offers a writeback performance improvement.
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
-rw-r--r-- | drivers/md/dm-cache-target.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c index 7829d947ef01..6d36ed3c46a0 100644 --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c | |||
@@ -418,10 +418,13 @@ static struct dm_cache_migration *alloc_migration(struct cache *cache) | |||
418 | 418 | ||
419 | static void free_migration(struct dm_cache_migration *mg) | 419 | static void free_migration(struct dm_cache_migration *mg) |
420 | { | 420 | { |
421 | if (atomic_dec_and_test(&mg->cache->nr_allocated_migrations)) | 421 | struct cache *cache = mg->cache; |
422 | wake_up(&mg->cache->migration_wait); | 422 | |
423 | if (atomic_dec_and_test(&cache->nr_allocated_migrations)) | ||
424 | wake_up(&cache->migration_wait); | ||
423 | 425 | ||
424 | mempool_free(mg, mg->cache->migration_pool); | 426 | mempool_free(mg, cache->migration_pool); |
427 | wake_worker(cache); | ||
425 | } | 428 | } |
426 | 429 | ||
427 | static int prealloc_data_structs(struct cache *cache, struct prealloc *p) | 430 | static int prealloc_data_structs(struct cache *cache, struct prealloc *p) |