Skip to content

Commit

Permalink
dm cache: wake the worker thread every time we free a migration object
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joe Thornber authored and Mike Snitzer committed Jun 11, 2015
1 parent 66a6363 commit 88bf518
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/md/dm-cache-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,13 @@ static struct dm_cache_migration *alloc_migration(struct cache *cache)

static void free_migration(struct dm_cache_migration *mg)
{
if (atomic_dec_and_test(&mg->cache->nr_allocated_migrations))
wake_up(&mg->cache->migration_wait);
struct cache *cache = mg->cache;

if (atomic_dec_and_test(&cache->nr_allocated_migrations))
wake_up(&cache->migration_wait);

mempool_free(mg, mg->cache->migration_pool);
mempool_free(mg, cache->migration_pool);
wake_worker(cache);
}

static int prealloc_data_structs(struct cache *cache, struct prealloc *p)
Expand Down

0 comments on commit 88bf518

Please sign in to comment.