[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH 1/1] block: ignore flush requests when storage i

From: Denis V. Lunev
Subject: Re: [Qemu-block] [PATCH 1/1] block: ignore flush requests when storage is clean
Date: Tue, 21 Jun 2016 11:17:21 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

On 06/21/2016 10:45 AM, Kevin Wolf wrote:
Am 21.06.2016 um 09:32 hat Paolo Bonzini geschrieben:

On 20/06/2016 17:19, Denis V. Lunev wrote:
+    /* Check if storage is actually dirty before flushing to disk */
+    if (!bs->dirty) {
+        goto flush_parent;
+    }
+    bs->dirty = false;
This should be cleared after the flush is complete.  If you have

     write begin
     write end
     flush #1 begin
     flush #2 begin

Then the second flush must only return after the first has finished.
I think clearing bs->dirty after the flush completion wouldn't
necessarily be right either if there are concurrent writes in flight, as
only completed writes are guaranteed to be flushed by it.

this is not a problem if flush 2 will return after flush 1.
This will mean that all writes prior to both flushes
will land to the disk.

Keeping this in mind dirty should be cleared before
flush operation start.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]