]> git.baikalelectronics.ru Git - kernel.git/commit
dm cache: age and write back cache entries even without active IO
authorJoe Thornber <ejt@redhat.com>
Fri, 29 May 2015 09:20:56 +0000 (10:20 +0100)
committerMike Snitzer <snitzer@redhat.com>
Thu, 11 Jun 2015 21:13:01 +0000 (17:13 -0400)
commit27a7a68dded1a78316b1114e92529bdd3c9a2935
tree9cfe1ba112421a7b18515d7854836a1b76aacb0b
parent0e825f8b0fc82998c76a6359c21dc7f1fd11f318
dm cache: age and write back cache entries even without active IO

The policy tick() method is normally called from interrupt context.
Both the mq and smq policies do some bottom half work for the tick
method in their map functions.  However if no IO is going through the
cache, then that bottom half work doesn't occur.  With these policies
this means recently hit entries do not age and do not get written
back as early as we'd like.

Fix this by introducing a new 'can_block' parameter to the tick()
method.  When this is set the bottom half work occurs immediately.
'can_block' is set when the tick method is called every second by the
core target (not in interrupt context).

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-cache-policy-internal.h
drivers/md/dm-cache-policy-mq.c
drivers/md/dm-cache-policy-smq.c
drivers/md/dm-cache-policy.h
drivers/md/dm-cache-target.c