]> git.proxmox.com Git - mirror_qemu.git/commit
qed: Periodically flush and clear need check bit
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Mon, 9 May 2011 15:45:40 +0000 (16:45 +0100)
committerKevin Wolf <kwolf@redhat.com>
Wed, 18 May 2011 12:38:46 +0000 (14:38 +0200)
commit6f321e93abb27b4e7ceb228b4204aa304e95daad
tree91a670fd257f3c412aeca38156112dc557491ce9
parent5fc09ca5c315b87539db882fba175a7955783530
qed: Periodically flush and clear need check bit

One strategy to limit the startup delay of consistency check when
opening image files is to ensure that the file is marked dirty for as
little time as possible.

QED currently marks the image dirty when the first allocating write
request is issued and clears the dirty bit again when the image is
cleanly closed.  In practice that means the image is marked dirty for
most of a guest's lifetime and prone to being in a dirty state upon
crash or power failure.

It is safe to clear the dirty bit after all allocating write requests
have completed and a flush has been performed.  This patch adds a timer
after the last allocating write request completes.  When the timer fires
it will flush and then clear the dirty bit.  The timer is set to 5
seconds and is cancelled upon arrival of a new allocating write request.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qed.c
block/qed.h
trace-events