devices: block: clear flush timer once it fires

Otherwise, the flush timer case of the PollContext continues to fire
repeatedly, since the timerfd remains readable.

BUG=None
TEST=Verify that crosvm virtio_blk thread no longer pins the CPU after
     writes are done

Change-Id: I693346c078e07b97e30083f34d00be75fa93841d
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1232295
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
This commit is contained in:
Daniel Verkamp 2018-09-18 14:59:13 -07:00 committed by chrome-bot
parent 616a093d91
commit 713dd60491

View file

@ -535,6 +535,10 @@ impl<T: DiskFile> Worker<T> {
error!("Failed to flush the disk: {:?}", e);
break 'poll;
}
if let Err(e) = flush_timer.wait() {
error!("Failed to clear flush timer: {:?}", e);
break 'poll;
}
}
Token::QueueAvailable => {
if let Err(e) = queue_evt.read() {