]> git.baikalelectronics.ru Git - kernel.git/commit
dm cache: fix problematic dual use of a single migration count variable
authorJoe Thornber <ejt@redhat.com>
Fri, 23 Jan 2015 10:16:16 +0000 (10:16 +0000)
committerMike Snitzer <snitzer@redhat.com>
Fri, 23 Jan 2015 16:06:08 +0000 (11:06 -0500)
commitca75db01414168aab624cf5bb51c73dfad4c54cb
tree6a9d52eb5cb2fc1db677636431e56e1797859a6c
parent786e70d36be3953f82dd6fe71cff8ba15bacbb49
dm cache: fix problematic dual use of a single migration count variable

Introduce a new variable to count the number of allocated migration
structures.  The existing variable cache->nr_migrations became
overloaded.  It was used to:

 i) track of the number of migrations in flight for the purposes of
    quiescing during suspend.

 ii) to estimate the amount of background IO occuring.

Recent discard changes meant that REQ_DISCARD bios are processed with
a migration.  Discards are not background IO so nr_migrations was not
incremented.  However this could cause quiescing to complete early.

(i) is now handled with a new variable cache->nr_allocated_migrations.
cache->nr_migrations has been renamed cache->nr_io_migrations.
cleanup_migration() is now called free_io_migration(), since it
decrements that variable.

Also, remove the unused cache->next_migration variable that got replaced
with with prealloc_structs a while ago.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
drivers/md/dm-cache-target.c