Skip to content

Commit

Permalink
dm cache: move wake_waker() from free_migrations() to where it is needed
Browse files Browse the repository at this point in the history
This stops spurious wake ups from calls to prealloc_free_structs().

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 Aug 12, 2015
1 parent 8c747fd commit e44b6a5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/md/dm-cache-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ static void free_migration(struct dm_cache_migration *mg)
wake_up(&cache->migration_wait);

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

static int prealloc_data_structs(struct cache *cache, struct prealloc *p)
Expand Down Expand Up @@ -1125,6 +1124,7 @@ static void free_io_migration(struct dm_cache_migration *mg)
{
dec_io_migrations(mg->cache);
free_migration(mg);
wake_worker(mg->cache);
}

static void migration_failure(struct dm_cache_migration *mg)
Expand Down Expand Up @@ -1361,6 +1361,7 @@ static void issue_discard(struct dm_cache_migration *mg)
bio_endio(bio, 0);
cell_defer(mg->cache, mg->new_ocell, false);
free_migration(mg);
wake_worker(mg->cache);
}

static void issue_copy_or_discard(struct dm_cache_migration *mg)
Expand Down

0 comments on commit e44b6a5

Please sign in to comment.