Re: [Qemu-devel] [PATCH] qed: fix bdrv_qed_drain

2016-03-07 Thread Paolo Bonzini
On 07/03/2016 21:56, Stefan Hajnoczi wrote: > I think the timer concept itself is troublesome. A radical approach but > limited to changing QED itself is to drop the timer and instead keep a > timestamp for the last allocating write request. Next time a write > request (allocating or rewriting)

Re: [Qemu-devel] [PATCH] qed: fix bdrv_qed_drain

2016-02-23 Thread Paolo Bonzini
On 23/02/2016 13:49, Fam Zheng wrote: > On Tue, 02/23 11:43, Paolo Bonzini wrote: >> >> >> On 23/02/2016 06:57, Fam Zheng wrote: >> +qed_cancel_need_check_timer(s); >> +qed_need_check_timer_cb(s); >> +} > > What if an allocating write is queued (the else br

Re: [Qemu-devel] [PATCH] qed: fix bdrv_qed_drain

2016-02-23 Thread Fam Zheng
On Tue, 02/23 11:43, Paolo Bonzini wrote: > > > On 23/02/2016 06:57, Fam Zheng wrote: > +qed_cancel_need_check_timer(s); > +qed_need_check_timer_cb(s); > +} > >>> > >>> What if an allocating write is queued (the else branch case)? Its > >>> completion > >>> wil

Re: [Qemu-devel] [PATCH] qed: fix bdrv_qed_drain

2016-02-23 Thread Paolo Bonzini
On 23/02/2016 06:57, Fam Zheng wrote: +qed_cancel_need_check_timer(s); +qed_need_check_timer_cb(s); +} >>> >>> What if an allocating write is queued (the else branch case)? Its completion >>> will be in bdrv_drain and it could arm the need_check_timer which is w

Re: [Qemu-devel] [PATCH] qed: fix bdrv_qed_drain

2016-02-22 Thread Fam Zheng
On Wed, 02/17 12:28, Paolo Bonzini wrote: > > > On 17/02/2016 03:57, Fam Zheng wrote: > > On Tue, 02/16 16:53, Paolo Bonzini wrote: > >> The current implementation of bdrv_qed_drain can cause a double > >> completion of a request. > >> > >> The problem is that bdrv_qed_drain calls qed_plug_alloca

Re: [Qemu-devel] [PATCH] qed: fix bdrv_qed_drain

2016-02-17 Thread Paolo Bonzini
On 17/02/2016 03:57, Fam Zheng wrote: > On Tue, 02/16 16:53, Paolo Bonzini wrote: >> The current implementation of bdrv_qed_drain can cause a double >> completion of a request. >> >> The problem is that bdrv_qed_drain calls qed_plug_allocating_write_reqs >> unconditionally, but this is not correc

Re: [Qemu-devel] [PATCH] qed: fix bdrv_qed_drain

2016-02-16 Thread Fam Zheng
On Tue, 02/16 16:53, Paolo Bonzini wrote: > The current implementation of bdrv_qed_drain can cause a double > completion of a request. > > The problem is that bdrv_qed_drain calls qed_plug_allocating_write_reqs > unconditionally, but this is not correct if an allocating write > is queued. In this

[Qemu-devel] [PATCH] qed: fix bdrv_qed_drain

2016-02-16 Thread Paolo Bonzini
The current implementation of bdrv_qed_drain can cause a double completion of a request. The problem is that bdrv_qed_drain calls qed_plug_allocating_write_reqs unconditionally, but this is not correct if an allocating write is queued. In this case, qed_unplug_allocating_write_reqs will restart t