All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-7.2] block/blkio: Set BlockDriver::has_variable_length to false
@ 2022-11-08 14:44 Alberto Faria
  2022-11-10 13:53 ` Kevin Wolf
  2022-11-10 21:01 ` Stefan Hajnoczi
  0 siblings, 2 replies; 4+ messages in thread
From: Alberto Faria @ 2022-11-08 14:44 UTC (permalink / raw)
  To: qemu-devel
  Cc: Stefan Hajnoczi, qemu-block, Hanna Reitz, Kevin Wolf, Alberto Faria

Setting it to true can cause the device size to be queried from libblkio
in otherwise fast paths, degrading performance. Set it to false and
require users to refresh the device size explicitly instead.

Fixes: 4c8f4fda0504 ("block/blkio: Tolerate device size changes")
Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Alberto Faria <afaria@redhat.com>
---
 block/blkio.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/block/blkio.c b/block/blkio.c
index 620fab28a7..5eae3adfaf 100644
--- a/block/blkio.c
+++ b/block/blkio.c
@@ -993,7 +993,6 @@ static void blkio_refresh_limits(BlockDriverState *bs, Error **errp)
     { \
         .format_name             = name, \
         .protocol_name           = name, \
-        .has_variable_length     = true, \
         .instance_size           = sizeof(BDRVBlkioState), \
         .bdrv_file_open          = blkio_file_open, \
         .bdrv_close              = blkio_close, \
-- 
2.38.1



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

* Re: [PATCH for-7.2] block/blkio: Set BlockDriver::has_variable_length to false
  2022-11-08 14:44 [PATCH for-7.2] block/blkio: Set BlockDriver::has_variable_length to false Alberto Faria
@ 2022-11-10 13:53 ` Kevin Wolf
  2022-11-10 21:01 ` Stefan Hajnoczi
  1 sibling, 0 replies; 4+ messages in thread
From: Kevin Wolf @ 2022-11-10 13:53 UTC (permalink / raw)
  To: Alberto Faria; +Cc: qemu-devel, Stefan Hajnoczi, qemu-block, Hanna Reitz

Am 08.11.2022 um 15:44 hat Alberto Faria geschrieben:
> Setting it to true can cause the device size to be queried from libblkio
> in otherwise fast paths, degrading performance. Set it to false and
> require users to refresh the device size explicitly instead.
> 
> Fixes: 4c8f4fda0504 ("block/blkio: Tolerate device size changes")
> Suggested-by: Kevin Wolf <kwolf@redhat.com>
> Signed-off-by: Alberto Faria <afaria@redhat.com>

Thanks, applied to the block branch.

Kevin



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

* Re: [PATCH for-7.2] block/blkio: Set BlockDriver::has_variable_length to false
  2022-11-08 14:44 [PATCH for-7.2] block/blkio: Set BlockDriver::has_variable_length to false Alberto Faria
  2022-11-10 13:53 ` Kevin Wolf
@ 2022-11-10 21:01 ` Stefan Hajnoczi
  2022-11-11 10:03   ` Kevin Wolf
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Hajnoczi @ 2022-11-10 21:01 UTC (permalink / raw)
  To: Alberto Faria
  Cc: qemu-devel, Stefan Hajnoczi, qemu-block, Hanna Reitz, Kevin Wolf

On Tue, 8 Nov 2022 at 09:45, Alberto Faria <afaria@redhat.com> wrote:
>
> Setting it to true can cause the device size to be queried from libblkio
> in otherwise fast paths, degrading performance. Set it to false and
> require users to refresh the device size explicitly instead.
>
> Fixes: 4c8f4fda0504 ("block/blkio: Tolerate device size changes")
> Suggested-by: Kevin Wolf <kwolf@redhat.com>
> Signed-off-by: Alberto Faria <afaria@redhat.com>

If it's okay to set it to false then that makes me wonder why this
undocumented field exists at all. Can you or Kevin explain and
possibly follow up with a patch that documents the field?

Thanks,
Stefan


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

* Re: [PATCH for-7.2] block/blkio: Set BlockDriver::has_variable_length to false
  2022-11-10 21:01 ` Stefan Hajnoczi
@ 2022-11-11 10:03   ` Kevin Wolf
  0 siblings, 0 replies; 4+ messages in thread
From: Kevin Wolf @ 2022-11-11 10:03 UTC (permalink / raw)
  To: Stefan Hajnoczi
  Cc: Alberto Faria, qemu-devel, Stefan Hajnoczi, qemu-block, Hanna Reitz

Am 10.11.2022 um 22:01 hat Stefan Hajnoczi geschrieben:
> On Tue, 8 Nov 2022 at 09:45, Alberto Faria <afaria@redhat.com> wrote:
> >
> > Setting it to true can cause the device size to be queried from libblkio
> > in otherwise fast paths, degrading performance. Set it to false and
> > require users to refresh the device size explicitly instead.
> >
> > Fixes: 4c8f4fda0504 ("block/blkio: Tolerate device size changes")
> > Suggested-by: Kevin Wolf <kwolf@redhat.com>
> > Signed-off-by: Alberto Faria <afaria@redhat.com>
> 
> If it's okay to set it to false then that makes me wonder why this
> undocumented field exists at all. Can you or Kevin explain and
> possibly follow up with a patch that documents the field?

It is for removable media backends (only host_cdrom has survived until
today; there used to be host_floppy, too) where the disk size can change
without an explicit block_resize when you change the medium.

I'm not sure how well this works in practice, but so far we've not
intentionally broken anything related to it that wasn't always broken.

Kevin



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

end of thread, other threads:[~2022-11-11 10:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08 14:44 [PATCH for-7.2] block/blkio: Set BlockDriver::has_variable_length to false Alberto Faria
2022-11-10 13:53 ` Kevin Wolf
2022-11-10 21:01 ` Stefan Hajnoczi
2022-11-11 10:03   ` Kevin Wolf

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.