dm log writes: don't use all the cpu while waiting to log blocks
authorJosef Bacik <jbacik@fb.com>
Fri, 28 Jul 2017 14:42:24 +0000 (10:42 -0400)
committerMike Snitzer <snitzer@redhat.com>
Mon, 11 Sep 2017 13:50:46 +0000 (09:50 -0400)
commit0c79c62021d23f0b5c942cf59d43a7ce6c24cd1b
tree8b8459eecabd432bdf38dce5dd3dc875211ca7ec
parentcf0dec6674c1e2a7ba326cfbbe7f05a70458afc9
dm log writes: don't use all the cpu while waiting to log blocks

The check to see if the logging kthread needs to go to sleep is wrong,
it checks lc->pending_blocks, which will be non-0 if there are any
blocks that are pending, whether they are ready to be logged or not.
What we really want is to go to sleep until it's time to log blocks, so
change this check so we do actually go to sleep in between flushes.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-log-writes.c