All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] macio: Use blk_drain instead of blk_drain_all
@ 2016-06-12  6:56 Fam Zheng
  2016-06-13  9:39 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
  2016-06-13 21:33 ` [Qemu-devel] " John Snow
  0 siblings, 2 replies; 7+ messages in thread
From: Fam Zheng @ 2016-06-12  6:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Snow, qemu-block

We only care about the associated backend, so blk_drain is more
appropriate here.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 hw/ide/macio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index 78c10a0..a8c7321 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -400,7 +400,7 @@ static void pmac_ide_flush(DBDMA_io *io)
     IDEState *s = idebus_active_if(&m->bus);
 
     if (s->bus->dma->aiocb) {
-        blk_drain_all();
+        blk_drain(s->blk);
     }
 }
 
-- 
2.8.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [Qemu-block] [PATCH] macio: Use blk_drain instead of blk_drain_all
  2016-06-12  6:56 [Qemu-devel] [PATCH] macio: Use blk_drain instead of blk_drain_all Fam Zheng
@ 2016-06-13  9:39 ` Kevin Wolf
  2016-06-14  1:20   ` Fam Zheng
  2016-06-14  9:08   ` Stefan Hajnoczi
  2016-06-13 21:33 ` [Qemu-devel] " John Snow
  1 sibling, 2 replies; 7+ messages in thread
From: Kevin Wolf @ 2016-06-13  9:39 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel, qemu-block, jsnow, mreitz, stefanha

Am 12.06.2016 um 08:56 hat Fam Zheng geschrieben:
> We only care about the associated backend, so blk_drain is more
> appropriate here.
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>

[ Cc: John ]

> ---
>  hw/ide/macio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/ide/macio.c b/hw/ide/macio.c
> index 78c10a0..a8c7321 100644
> --- a/hw/ide/macio.c
> +++ b/hw/ide/macio.c
> @@ -400,7 +400,7 @@ static void pmac_ide_flush(DBDMA_io *io)
>      IDEState *s = idebus_active_if(&m->bus);
>  
>      if (s->bus->dma->aiocb) {
> -        blk_drain_all();
> +        blk_drain(s->blk);
>      }
>  }

Looks good to me:

Reviewed-by: Kevin Wolf <kwolf@redhat.com>

However, even this is still doing too much. We only need to drain the
requests that come from this device and can ignore e.g. block job
requests.

Now the part that I'm not completely sure about is whether the problem
is here in the IDE emulation and it should track its own requests or
whether it is blk_drain() that actually shouldn't drain the BDS but just
all requests that came in through this specific BB.

I'm leaning towards the latter, but I'm unsure whether we have cases
where we actually need to drain the whole root BDS. Any opinions?

Kevin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] macio: Use blk_drain instead of blk_drain_all
  2016-06-12  6:56 [Qemu-devel] [PATCH] macio: Use blk_drain instead of blk_drain_all Fam Zheng
  2016-06-13  9:39 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
@ 2016-06-13 21:33 ` John Snow
  2016-06-14  1:21   ` Fam Zheng
  1 sibling, 1 reply; 7+ messages in thread
From: John Snow @ 2016-06-13 21:33 UTC (permalink / raw)
  To: Fam Zheng, qemu-devel; +Cc: qemu-block



On 06/12/2016 02:56 AM, Fam Zheng wrote:
> We only care about the associated backend, so blk_drain is more
> appropriate here.
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  hw/ide/macio.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/ide/macio.c b/hw/ide/macio.c
> index 78c10a0..a8c7321 100644
> --- a/hw/ide/macio.c
> +++ b/hw/ide/macio.c
> @@ -400,7 +400,7 @@ static void pmac_ide_flush(DBDMA_io *io)
>      IDEState *s = idebus_active_if(&m->bus);
>  
>      if (s->bus->dma->aiocb) {
> -        blk_drain_all();
> +        blk_drain(s->blk);
>      }
>  }
>  
> 

Reviewed-by: John Snow <jsnow@redhat.com>

Shall I take this through my tree?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [Qemu-block] [PATCH] macio: Use blk_drain instead of blk_drain_all
  2016-06-13  9:39 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
@ 2016-06-14  1:20   ` Fam Zheng
  2016-06-14  9:08   ` Stefan Hajnoczi
  1 sibling, 0 replies; 7+ messages in thread
From: Fam Zheng @ 2016-06-14  1:20 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel, qemu-block, jsnow, mreitz, stefanha

On Mon, 06/13 11:39, Kevin Wolf wrote:
> Am 12.06.2016 um 08:56 hat Fam Zheng geschrieben:
> > We only care about the associated backend, so blk_drain is more
> > appropriate here.
> > 
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> 
> [ Cc: John ]
> 
> > ---
> >  hw/ide/macio.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/hw/ide/macio.c b/hw/ide/macio.c
> > index 78c10a0..a8c7321 100644
> > --- a/hw/ide/macio.c
> > +++ b/hw/ide/macio.c
> > @@ -400,7 +400,7 @@ static void pmac_ide_flush(DBDMA_io *io)
> >      IDEState *s = idebus_active_if(&m->bus);
> >  
> >      if (s->bus->dma->aiocb) {
> > -        blk_drain_all();
> > +        blk_drain(s->blk);
> >      }
> >  }
> 
> Looks good to me:
> 
> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
> 
> However, even this is still doing too much. We only need to drain the
> requests that come from this device and can ignore e.g. block job
> requests.
> 
> Now the part that I'm not completely sure about is whether the problem
> is here in the IDE emulation and it should track its own requests or
> whether it is blk_drain() that actually shouldn't drain the BDS but just
> all requests that came in through this specific BB.
> 
> I'm leaning towards the latter, but I'm unsure whether we have cases
> where we actually need to drain the whole root BDS. Any opinions?

I agree with you and think the latter is better in this case. I think the one
in migration/block.c need to drain the whole root BDS, and others don't.

Fam

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] macio: Use blk_drain instead of blk_drain_all
  2016-06-13 21:33 ` [Qemu-devel] " John Snow
@ 2016-06-14  1:21   ` Fam Zheng
  2016-06-14 20:26     ` John Snow
  0 siblings, 1 reply; 7+ messages in thread
From: Fam Zheng @ 2016-06-14  1:21 UTC (permalink / raw)
  To: John Snow; +Cc: qemu-devel, qemu-block

On Mon, 06/13 17:33, John Snow wrote:
> 
> 
> On 06/12/2016 02:56 AM, Fam Zheng wrote:
> > We only care about the associated backend, so blk_drain is more
> > appropriate here.
> > 
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> >  hw/ide/macio.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/hw/ide/macio.c b/hw/ide/macio.c
> > index 78c10a0..a8c7321 100644
> > --- a/hw/ide/macio.c
> > +++ b/hw/ide/macio.c
> > @@ -400,7 +400,7 @@ static void pmac_ide_flush(DBDMA_io *io)
> >      IDEState *s = idebus_active_if(&m->bus);
> >  
> >      if (s->bus->dma->aiocb) {
> > -        blk_drain_all();
> > +        blk_drain(s->blk);
> >      }
> >  }
> >  
> > 
> 
> Reviewed-by: John Snow <jsnow@redhat.com>
> 
> Shall I take this through my tree?

I think that MAINTAINERS says so. :)

Fam

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [Qemu-block] [PATCH] macio: Use blk_drain instead of blk_drain_all
  2016-06-13  9:39 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
  2016-06-14  1:20   ` Fam Zheng
@ 2016-06-14  9:08   ` Stefan Hajnoczi
  1 sibling, 0 replies; 7+ messages in thread
From: Stefan Hajnoczi @ 2016-06-14  9:08 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: Fam Zheng, qemu-devel, qemu-block, jsnow, mreitz

[-- Attachment #1: Type: text/plain, Size: 1931 bytes --]

On Mon, Jun 13, 2016 at 11:39:48AM +0200, Kevin Wolf wrote:
> Am 12.06.2016 um 08:56 hat Fam Zheng geschrieben:
> > We only care about the associated backend, so blk_drain is more
> > appropriate here.
> > 
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> 
> [ Cc: John ]
> 
> > ---
> >  hw/ide/macio.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/hw/ide/macio.c b/hw/ide/macio.c
> > index 78c10a0..a8c7321 100644
> > --- a/hw/ide/macio.c
> > +++ b/hw/ide/macio.c
> > @@ -400,7 +400,7 @@ static void pmac_ide_flush(DBDMA_io *io)
> >      IDEState *s = idebus_active_if(&m->bus);
> >  
> >      if (s->bus->dma->aiocb) {
> > -        blk_drain_all();
> > +        blk_drain(s->blk);
> >      }
> >  }
> 
> Looks good to me:
> 
> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
> 
> However, even this is still doing too much. We only need to drain the
> requests that come from this device and can ignore e.g. block job
> requests.
> 
> Now the part that I'm not completely sure about is whether the problem
> is here in the IDE emulation and it should track its own requests or
> whether it is blk_drain() that actually shouldn't drain the BDS but just
> all requests that came in through this specific BB.
> 
> I'm leaning towards the latter, but I'm unsure whether we have cases
> where we actually need to drain the whole root BDS. Any opinions?

There seem to be two distinct drain use cases:

1. Complete all requests that have been submitted via this BB.

2. Quiesce the BDS sub-graph so operations can be performed without
   in-flight I/O intefering.

Device emulation usually needs #1.  Live migration and monitor commands
need #2.

We could distinguish the two by making blk_drain() have #1 semantics
only.  Users that need #2 must use new
blk_drained_begin()/blk_drained_end() functions so the quiescent region
is explicit.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [PATCH] macio: Use blk_drain instead of blk_drain_all
  2016-06-14  1:21   ` Fam Zheng
@ 2016-06-14 20:26     ` John Snow
  0 siblings, 0 replies; 7+ messages in thread
From: John Snow @ 2016-06-14 20:26 UTC (permalink / raw)
  To: Fam Zheng; +Cc: qemu-devel, qemu-block



On 06/13/2016 09:21 PM, Fam Zheng wrote:
> On Mon, 06/13 17:33, John Snow wrote:
>>
>>
>> On 06/12/2016 02:56 AM, Fam Zheng wrote:
>>> We only care about the associated backend, so blk_drain is more
>>> appropriate here.
>>>
>>> Signed-off-by: Fam Zheng <famz@redhat.com>
>>> ---
>>>  hw/ide/macio.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/hw/ide/macio.c b/hw/ide/macio.c
>>> index 78c10a0..a8c7321 100644
>>> --- a/hw/ide/macio.c
>>> +++ b/hw/ide/macio.c
>>> @@ -400,7 +400,7 @@ static void pmac_ide_flush(DBDMA_io *io)
>>>      IDEState *s = idebus_active_if(&m->bus);
>>>  
>>>      if (s->bus->dma->aiocb) {
>>> -        blk_drain_all();
>>> +        blk_drain(s->blk);
>>>      }
>>>  }
>>>  
>>>
>>
>> Reviewed-by: John Snow <jsnow@redhat.com>
>>
>> Shall I take this through my tree?
> 
> I think that MAINTAINERS says so. :)
> 
> Fam
> 

For now, then:

Thanks, applied to my IDE tree:

https://github.com/jnsnow/qemu/commits/ide
https://github.com/jnsnow/qemu.git

--js

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-06-14 20:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-12  6:56 [Qemu-devel] [PATCH] macio: Use blk_drain instead of blk_drain_all Fam Zheng
2016-06-13  9:39 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2016-06-14  1:20   ` Fam Zheng
2016-06-14  9:08   ` Stefan Hajnoczi
2016-06-13 21:33 ` [Qemu-devel] " John Snow
2016-06-14  1:21   ` Fam Zheng
2016-06-14 20:26     ` John Snow

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.