Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Joe Thornber and committed by
Mike Snitzer
88bf5184 66a63635

+6 -3
+6 -3
drivers/md/dm-cache-target.c
··· 418 418 419 419 static void free_migration(struct dm_cache_migration *mg) 420 420 { 421 - if (atomic_dec_and_test(&mg->cache->nr_allocated_migrations)) 422 - wake_up(&mg->cache->migration_wait); 421 + struct cache *cache = mg->cache; 423 422 424 - mempool_free(mg, mg->cache->migration_pool); 423 + if (atomic_dec_and_test(&cache->nr_allocated_migrations)) 424 + wake_up(&cache->migration_wait); 425 + 426 + mempool_free(mg, cache->migration_pool); 427 + wake_worker(cache); 425 428 } 426 429 427 430 static int prealloc_data_structs(struct cache *cache, struct prealloc *p)