From: Joe Thornber Date: Wed, 27 May 2015 14:39:45 +0000 (+0100) Subject: dm cache: wake the worker thread every time we free a migration object X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=88bf5184fa5861e766e39fd34fc6d21557ac7be8;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Mike Snitzer --- 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) 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)