Re: [Qemu-devel] [PATCH 1/1] block: ignore flush requests when storage is clean

2016-06-21 Thread Kevin Wolf
Am 21.06.2016 um 10:17 hat Denis V. Lunev geschrieben: > 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 (!b

Re: [Qemu-devel] [PATCH 1/1] block: ignore flush requests when storage is clean

2016-06-21 Thread Denis V. Lunev
On 06/21/2016 10:32 AM, Paolo Bonzini wrote: 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.

Re: [Qemu-devel] [PATCH 1/1] block: ignore flush requests when storage is clean

2016-06-21 Thread Denis V. Lunev
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; +

Re: [Qemu-devel] [PATCH 1/1] block: ignore flush requests when storage is clean

2016-06-21 Thread Kevin Wolf
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

Re: [Qemu-devel] [PATCH 1/1] block: ignore flush requests when storage is clean

2016-06-21 Thread Paolo Bonzini
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 w

Re: [Qemu-devel] [PATCH 1/1] block: ignore flush requests when storage is clean

2016-06-20 Thread Eric Blake
On 06/20/2016 09:19 AM, Denis V. Lunev wrote: > From: Evgeny Yakovlev > > Some guests (win2008 server for example) do a lot of unnecessary > flushing when underlying media has not changed. This adds additional > overhead on host when calling fsync/fdatasync. > > This change introduces a dirty fl

[Qemu-devel] [PATCH 1/1] block: ignore flush requests when storage is clean

2016-06-20 Thread Denis V. Lunev
From: Evgeny Yakovlev Some guests (win2008 server for example) do a lot of unnecessary flushing when underlying media has not changed. This adds additional overhead on host when calling fsync/fdatasync. This change introduces a dirty flag in BlockDriverState which is set in bdrv_set_dirty and is