qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: Max Reitz <mreitz@redhat.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com,
	fam@euphon.net, stefanha@redhat.com, kwolf@redhat.com,
	den@openvz.org, nsoffer@redhat.com
Subject: Re: [PATCH v5 00/10] preallocate filter
Date: Thu, 17 Sep 2020 12:00:16 +0300	[thread overview]
Message-ID: <443207f5-b6e6-0e4e-e3c5-80d2fb0ddcb1@virtuozzo.com> (raw)
In-Reply-To: <1c027e2c-651c-7077-09e3-f94c71c6dde7@redhat.com>

01.09.2020 18:07, Max Reitz wrote:
> On 27.08.20 23:08, Vladimir Sementsov-Ogievskiy wrote:
>> 21.08.2020 17:11, Vladimir Sementsov-Ogievskiy wrote:
>>> Hi all!
>>>
>>> Here is a filter, which does preallocation on write.
>>>
>>> In Virtuozzo we have to deal with some custom distributed storage
>>> solution, where allocation is relatively expensive operation. We have to
>>> workaround it in Qemu, so here is a new filter.
>>
>> I have a problem now with this thing.
>>
>> We need preallocation. But we don't want to explicitly specify it in all
>> the management tools.
> 
> Why?
> 
>> So it should be inserted by default.
> 
> Why?  You mean without any option?  That seems...  Interesting?
> 
> (Also like a recipe for reports of performance regression in some cases.)
> 
>> It's OK for
>> us to keep this default different from upstream... But there are
>> problems with the implicitly inserted filter (actually iotests fail and
>> I failed to fix them)
> 
> I would suspect even if the iotests passed we would end up with a heap
> of problems that we would only notice at some later point.  I thought
> you too weren’t too fond of the idea of implicit filters.
> 
>> 1. I have to set bs->inherits_from for filter and it's child by hand
>> after bdrv_replace_node(), otherwise bdrv_check_perm doesn't work.
>>
>> 2. I have to set filter_bs->implicit and teach bdrv_refresh_filename()
>> to ignore implicit filters when it checks for drv->bdrv_file_open, to
>> avoid appearing of json in backing file names
>>
>> 3. And the real design problem, which seems impossible to fix: reopen is
>> broken, just because user is not prepared to the fact that file child is
>> a filter, not a file node and has another options, and don't support
>> options of file-posix.
> 
> Well, what should I say.  I feel like we have made efforts in the past
> years to make the block graph fully visible to users and yield the
> responsibility of managing it to the users, too, so I’m not surprised if
> a step backwards breaks that.
> 
>> And seems all it (and mostly [3]) shows that implicitly inserting the
>> filter is near to be impossible..
>>
>> So, what are possible solutions?
>>
>> In virtuozzo7 we have preallocation feature done inside qcow2 driver.
>> This is very uncomfortable: we should to handle each possible over-EOF
>> write to underlying node (to keep data_end in sync to be able to shrink
>> preallocation on close()).. I don't like this way and don't want to port
>> it..
>>
>> Another option is implementing preallocation inside file-posix driver.
>> Then, instead of BDRV_REQ_NO_WAIT flag I'll need to extend serialising
>> requests API (bdrv_make_request_serialising() is already used in
>> file-posix.c) to dupport no-wait behavior + expanding the serialising
>> request bounds. This option seems feasible, so I'll try this way if no
>> other ideas.
> 
> Possible, but you haven’t yet explained what the problem with the
> management layer inserting the preallocation filter is.
> 
>> Filter is obviously the true way: we use generic block layer for native
>> request serialising, don't need to catch every write in qcow2 driver,
>> don't need to modify any other driver and get a universal thing. But how
>> to insert it implicitly (or at least automatically in some cases) and
>> avoid all the problems?
> 
> I don’t understand why inserting it implicitly is important.
> 

You are right. Thanks for strong point of view, this makes me to revise my own. Now I'm working on v6.

-- 
Best regards,
Vladimir


      reply	other threads:[~2020-09-17  9:02 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-21 14:11 [PATCH v5 00/10] preallocate filter Vladimir Sementsov-Ogievskiy
2020-08-21 14:11 ` [PATCH v5 01/10] block: simplify comment to BDRV_REQ_SERIALISING Vladimir Sementsov-Ogievskiy
2020-08-21 14:11 ` [PATCH v5 02/10] block/io.c: drop assertion on double waiting for request serialisation Vladimir Sementsov-Ogievskiy
2020-08-21 14:11 ` [PATCH v5 03/10] block/io: split out bdrv_find_conflicting_request Vladimir Sementsov-Ogievskiy
2020-08-21 14:11 ` [PATCH v5 04/10] block/io: bdrv_wait_serialising_requests_locked: drop extra bs arg Vladimir Sementsov-Ogievskiy
2020-08-21 14:11 ` [PATCH v5 05/10] block: bdrv_mark_request_serialising: split non-waiting function Vladimir Sementsov-Ogievskiy
2020-08-25 12:43   ` Max Reitz
2020-08-21 14:11 ` [PATCH v5 06/10] block: introduce BDRV_REQ_NO_WAIT flag Vladimir Sementsov-Ogievskiy
2020-08-25 13:10   ` Max Reitz
2020-08-26  6:26     ` Vladimir Sementsov-Ogievskiy
2020-08-26  8:36       ` Max Reitz
2020-08-26  8:57         ` Vladimir Sementsov-Ogievskiy
2020-08-21 14:11 ` [PATCH v5 07/10] block: introduce preallocate filter Vladimir Sementsov-Ogievskiy
2020-08-24 17:52   ` Vladimir Sementsov-Ogievskiy
2020-08-26  7:06     ` Vladimir Sementsov-Ogievskiy
2020-08-25 15:11   ` Max Reitz
2020-08-26  6:49     ` Vladimir Sementsov-Ogievskiy
2020-08-26  8:52       ` Max Reitz
2020-08-26  9:15         ` Vladimir Sementsov-Ogievskiy
2020-08-26  9:58           ` Max Reitz
2020-08-26 11:29             ` Vladimir Sementsov-Ogievskiy
2020-08-26 13:51     ` David Edmondson
2020-08-27  9:19       ` Vladimir Sementsov-Ogievskiy
2020-08-21 14:11 ` [PATCH v5 08/10] iotests.py: add verify_o_direct helper Vladimir Sementsov-Ogievskiy
2020-08-21 17:29   ` Nir Soffer
2020-08-21 14:11 ` [PATCH v5 09/10] iotests.py: add filter_img_check Vladimir Sementsov-Ogievskiy
2020-08-21 14:11 ` [PATCH v5 10/10] iotests: add 298 to test new preallocate filter driver Vladimir Sementsov-Ogievskiy
2020-08-27 21:08 ` [PATCH v5 00/10] preallocate filter Vladimir Sementsov-Ogievskiy
2020-09-01 15:07   ` Max Reitz
2020-09-17  9:00     ` Vladimir Sementsov-Ogievskiy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=443207f5-b6e6-0e4e-e3c5-80d2fb0ddcb1@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=armbru@redhat.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=nsoffer@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).