提交 0c79c620 编写于 作者: J Josef Bacik 提交者: Mike Snitzer

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: NJosef Bacik <jbacik@fb.com>
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
上级 cf0dec66
......@@ -399,7 +399,7 @@ static int log_writes_kthread(void *arg)
if (!try_to_freeze()) {
set_current_state(TASK_INTERRUPTIBLE);
if (!kthread_should_stop() &&
!atomic_read(&lc->pending_blocks))
list_empty(&lc->logging_blocks))
schedule();
__set_current_state(TASK_RUNNING);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册