All of lore.kernel.org
 help / color / mirror / Atom feed
* aio-context question
@ 2020-03-19  8:13 Dietmar Maurer
  2020-03-23 17:07 ` Kevin Wolf
  0 siblings, 1 reply; 3+ messages in thread
From: Dietmar Maurer @ 2020-03-19  8:13 UTC (permalink / raw)
  To: kwolf, qemu-devel

I just saw commit 30dd65f307b647eef8156c4a33bd007823ef85cb, and noticed that 
a similar pattern in drive_backup_prepare() and blockdev_backup_prepare().

The calls to bdrv_try_set_aio_context() seems useless, because we already do
that later in backup_job_create/brdv_attach.

But I am not 100%& sure?



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

* Re: aio-context question
  2020-03-19  8:13 aio-context question Dietmar Maurer
@ 2020-03-23 17:07 ` Kevin Wolf
  2020-03-23 18:13   ` Dietmar Maurer
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Wolf @ 2020-03-23 17:07 UTC (permalink / raw)
  To: Dietmar Maurer; +Cc: qemu-devel

Am 19.03.2020 um 09:13 hat Dietmar Maurer geschrieben:
> I just saw commit 30dd65f307b647eef8156c4a33bd007823ef85cb, and noticed that 
> a similar pattern in drive_backup_prepare() and blockdev_backup_prepare().
> 
> The calls to bdrv_try_set_aio_context() seems useless, because we already do
> that later in backup_job_create/brdv_attach.
> 
> But I am not 100%& sure?

I'm aware that this is a common pattern (and I thought it was more than
just two additional places), but we would have to check for each place
individually whether it can be removed.

If it doesn't have any effect because it just does what will be done
later anyway, it can be removed, but that doesn't buy us much.

If it results in preventing some case (like the one fixed by 30dd65f3),
we need to check whether this case is actually safe. If it is safe, we
can remove the lines and get a new feature from it.

In both cases, I think a test case should be written together with the
removal of the code. And if we find out that it's unsafe, we should even
more write a test case that makes sure that the operation fails.

Kevin



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

* Re: aio-context question
  2020-03-23 17:07 ` Kevin Wolf
@ 2020-03-23 18:13   ` Dietmar Maurer
  0 siblings, 0 replies; 3+ messages in thread
From: Dietmar Maurer @ 2020-03-23 18:13 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel

> If it doesn't have any effect because it just does what will be done
> later anyway, it can be removed, but that doesn't buy us much.

I think that code is simply unnecessary (no effect).
But it is quite hard to read and understand, so I think removing
that code helps to simplify things.

> If it results in preventing some case (like the one fixed by 30dd65f3),
> we need to check whether this case is actually safe. If it is safe, we
> can remove the lines and get a new feature from it.
> 
> In both cases, I think a test case should be written together with the
> removal of the code. And if we find out that it's unsafe, we should even
> more write a test case that makes sure that the operation fails.

Yes, a test case would be great. Especially one that test backups with
io-threads. 

I am hunting a bug for more than a week now. Seems bdrv_drain hangs 
sometimes when running a backup job on drives using io-threads ...

But I still haven't found a reliable way to reproduce it.
Sometimes takes me several hours to trigger it again... 

I will try to write a test case if I can really find that bug...



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

end of thread, other threads:[~2020-03-23 18:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-19  8:13 aio-context question Dietmar Maurer
2020-03-23 17:07 ` Kevin Wolf
2020-03-23 18:13   ` Dietmar Maurer

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.