Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88bf5184 authored by Joe Thornber's avatar Joe Thornber Committed by Mike Snitzer
Browse files

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: default avatarJoe Thornber <ejt@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 66a63635
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -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)