* Re: [SPDK] Dynamic base bdev management for multi-tenant virtual bdev
@ 2018-06-20 17:24 Walker, Benjamin
0 siblings, 0 replies; 6+ messages in thread
From: Walker, Benjamin @ 2018-06-20 17:24 UTC (permalink / raw)
To: spdk
[-- Attachment #1: Type: text/plain, Size: 5474 bytes --]
Hi Andrey,
I'm trying to get back to some messages that slipped through the cracks. I think
what you're doing here is important and needs to be addressed. Responses inline.
On Thu, 2018-05-31 at 14:16 +0300, Andrey Kuzmin wrote:
> Planning for a multi-tenant virtual bdev driver, I looked into the provided
> base bdev management capabilities and found them short of what I need. The
> issues I see are outlined below. Let me know if the analysis is correct and,
> if yes, are there any plans to provide for the dynamic base bdev management
> capabilities in the multi-tenant vbdev use case.
>
> 1. Vbdev startup
>
> spdk_vbdev_register at present allows one to register a completely assembled
> vbdev (with all base bdevs already examined) only. The root cause behind that
> fully-assembled requirement above is spdk_vbdev_set_base_bdevs call that
> follows, which assumes that vbdev's base bdevs haven't been set up yet.
>
> Apparently, a non-trivial multi-tenant vbdev should be allowed to start up in
> a partially assembled state; erasure code-based RAID provides a ready-made
> example of a vbdev that is expected to be/remain operational while an
> arbitrary number of base bdevs is missing permanently or temporarily, in
> particular (but not limited to) at startup time.
>
> Furthermore, a vbdev like this should be able to register a hot-plugged base
> bdev at any point of runtime, yet again pointing to the need for a
> vbdev_register_base_bdev(vbdev, base_bdev) call in addition to/in replacement
> of the available spdk_vbdev_set_base_bdevs method (more on this under Bdev hot
> plug below).
I agree that bdev modules should be able to expose bdevs that are only partially
assembled and at run time add or remove base bdevs as necessary. I also agree
that the vbdev_* API has a lot of assumptions about when the base bdevs are
known, and that is not going to work for you. However, the vbdev_* APIs are
convenience wrappers only. You can perform every required operation in a bdev
module without using those, and I think that's what you're going to want to do
here. I think we need to audit the bdev module API and clarify which operations
are the "fundamental" ones and which are these convenience vbdev things that
work for 90% of vbdevs but not all of them. Since you sent this note, I've
created a public header file that is intended to define the bdev module API
officially (include/spdk/bdev_module.h). Now we just need to iterate on that to
make it clearer.
>
> 2. Bdev surprise removal
>
> SPDK bdev ops vector includes .hotremove method which, for each open base bdev
> descriptor, gives vbdev module an opportunity to clean up and/or do any
> redundancy-related base bdev management.
>
> While .hotremove provides for the vbdev-internal bdev management on hot
> remove, spdk_bdev_unregister which completes hot-remove handling in the bdev
> layer does not remove base bdev from vbdev's base bdev list, so base bdev in
> question still sits on the list after being removed. The reason is likely the
> missing vbdev->base_bdevs dynamic management in general and
> vbdev_remove_base_bdev(vbdev, bdev) call in particular, required to manage
> vbdev->base_bdevs list on a single bdev removal.
Agreed - the vbdev wrappers need to either be improved, or you need to use the
lower level APIs.
>
> 3 Bdev hot plug
>
> At present virtual bdev design does seem to provide any support for base bdev
> hot-plug. Vbdev's extant .examine method seems to be geared toward initial
> vbdev setup in that it assumes no open vbdev descriptors (so that vbdev to
> base bdevs descriptor linkage occurs when vbdev is subsequently opened and its
> I/O channels are created).
>
> There is currently no .hotplug mechanism complementary to .hotremove that
> would propagate base bdev insertion throughout all open vbdev descriptors, so
> that vbdev has a chance to set up the I/O channel/do other house-keeping for
> the plugged base bdev on each vbdev descriptor/channel open at the moment of
> the base bdev insertion.
You need a mechanism such that on hot-insert a message is sent to each existing
I/O channel for the bdev to perform per-channel initialization? Can you just
call spdk_for_each_channel?
>
> 4. Vbdev shutdown
>
> It appears that, while bdev subsystem start-up proceeds in the expected
> bottom-up fashion, with vbdevs instantiated as the underlying base bdevs show
> up, the reverse is not true: on bdev subsystem shutdown, I see vbdev's
> .hotremove being called where I would expect vbdev being closed/unregistered.
>
> Understandably, for a vbdev module author it would be very helpful to be able
> to differentiate between planned (sub)system shutdown and hot removal of a
> base bdev at run time; for this to happen, bdev subsystem shutdown should
> proceed top-down, with virtual bdevs unregistered prior to the underlying
> bdevs.
I agree - Pawel Wodkowski is working in this area.
I also wanted to mention that a few patches have gone in which allow the lvol
bdev module to perform its examine without write access. At least one more patch
is required still, but once complete we can merge your patch that separates
claiming bdevs from opening them.
Once that is done, we need to begin work to differentiate the various reasons a
bdev could be examined and the various reasons a bdev could be removed.
Thanks,
Ben
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [SPDK] Dynamic base bdev management for multi-tenant virtual bdev
@ 2018-06-20 20:18 Andrey Kuzmin
0 siblings, 0 replies; 6+ messages in thread
From: Andrey Kuzmin @ 2018-06-20 20:18 UTC (permalink / raw)
To: spdk
[-- Attachment #1: Type: text/plain, Size: 9132 bytes --]
Ben,
just to let you know, I've submitted
<https://review.gerrithub.io/c/spdk/spdk/+/416246> the patch mentioned
below for review.
Regards,
Andrey
On Wed, Jun 20, 2018 at 10:03 PM Andrey Kuzmin <andrey.v.kuzmin(a)gmail.com>
wrote:
> Hi Ben,
>
> glad to see this moving forward.
>
> On Wed, Jun 20, 2018 at 8:24 PM Walker, Benjamin <
> benjamin.walker(a)intel.com> wrote:
>
>> Hi Andrey,
>>
>> I'm trying to get back to some messages that slipped through the cracks.
>> I think
>> what you're doing here is important and needs to be addressed. Responses
>> inline.
>>
>
> You've actually caught me up in the process of writing a status update
> email which, to make the long story short, is very much inline with what
> you write below.
>
> With some cosmetic changes (mostly related to vbdev->base_bdevs and
> bdev->vbdevs run-time management), I was able to get a multi-tenant vbdev
> properly handle its base bdev's hot-plug/remove events. The major
> ingredient of the spdk bdev layer infrastructure I was missing is the
> channel iterator that proved to be the key to safely disabling/enabling
> channels for the base bdev being removed/added. Other than that, the only
> truly missing ting was just the base bdev addition under vbdev->base_bdevs
> at run-time and some minor extras (which I can turn into a specific patch
> and submit for review), so bdev layer has basically proven me wrong. The
> item standing out is bdev subsystem initialization/shutdown, more on this
> inline below.
>
>
>>
>> On Thu, 2018-05-31 at 14:16 +0300, Andrey Kuzmin wrote:
>> > Planning for a multi-tenant virtual bdev driver, I looked into the
>> provided
>> > base bdev management capabilities and found them short of what I need.
>> The
>> > issues I see are outlined below. Let me know if the analysis is correct
>> and,
>> > if yes, are there any plans to provide for the dynamic base bdev
>> management
>> > capabilities in the multi-tenant vbdev use case.
>> >
>> > 1. Vbdev startup
>> >
>> > spdk_vbdev_register at present allows one to register a completely
>> assembled
>> > vbdev (with all base bdevs already examined) only. The root cause
>> behind that
>> > fully-assembled requirement above is spdk_vbdev_set_base_bdevs call
>> that
>> > follows, which assumes that vbdev's base bdevs haven't been set up yet.
>> >
>> > Apparently, a non-trivial multi-tenant vbdev should be allowed to start
>> up in
>> > a partially assembled state; erasure code-based RAID provides a
>> ready-made
>> > example of a vbdev that is expected to be/remain operational while an
>> > arbitrary number of base bdevs is missing permanently or temporarily, in
>> > particular (but not limited to) at startup time.
>> >
>> > Furthermore, a vbdev like this should be able to register a hot-plugged
>> base
>> > bdev at any point of runtime, yet again pointing to the need for a
>> > vbdev_register_base_bdev(vbdev, base_bdev) call in addition to/in
>> replacement
>> > of the available spdk_vbdev_set_base_bdevs method (more on this under
>> Bdev hot
>> > plug below).
>>
>> I agree that bdev modules should be able to expose bdevs that are only
>> partially
>> assembled and at run time add or remove base bdevs as necessary. I also
>> agree
>> that the vbdev_* API has a lot of assumptions about when the base bdevs
>> are
>> known, and that is not going to work for you. However, the vbdev_* APIs
>> are
>> convenience wrappers only. You can perform every required operation in a
>> bdev
>> module without using those, and I think that's what you're going to want
>> to do
>> here. I think we need to audit the bdev module API and clarify which
>> operations
>> are the "fundamental" ones and which are these convenience vbdev things
>> that
>> work for 90% of vbdevs but not all of them. Since you sent this note, I've
>> created a public header file that is intended to define the bdev module
>> API
>> officially (include/spdk/bdev_module.h). Now we just need to iterate on
>> that to
>> make it clearer.
>>
>
> Yes, I noticed this one.
>
>>
>> >
>> > 2. Bdev surprise removal
>> >
>> > SPDK bdev ops vector includes .hotremove method which, for each open
>> base bdev
>> > descriptor, gives vbdev module an opportunity to clean up and/or do any
>> > redundancy-related base bdev management.
>> >
>> > While .hotremove provides for the vbdev-internal bdev management on hot
>> > remove, spdk_bdev_unregister which completes hot-remove handling in the
>> bdev
>> > layer does not remove base bdev from vbdev's base bdev list, so base
>> bdev in
>> > question still sits on the list after being removed. The reason is
>> likely the
>> > missing vbdev->base_bdevs dynamic management in general and
>> > vbdev_remove_base_bdev(vbdev, bdev) call in particular, required to
>> manage
>> > vbdev->base_bdevs list on a single bdev removal.
>>
>> Agreed - the vbdev wrappers need to either be improved, or you need to
>> use the
>> lower level APIs.
>>
>
> I have a patch for this specifically.
>
>
>> >
>> > 3 Bdev hot plug
>> >
>> > At present virtual bdev design does seem to provide any support for
>> base bdev
>> > hot-plug. Vbdev's extant .examine method seems to be geared toward
>> initial
>> > vbdev setup in that it assumes no open vbdev descriptors (so that vbdev
>> to
>> > base bdevs descriptor linkage occurs when vbdev is subsequently opened
>> and its
>> > I/O channels are created).
>> >
>> > There is currently no .hotplug mechanism complementary to .hotremove
>> that
>> > would propagate base bdev insertion throughout all open vbdev
>> descriptors, so
>> > that vbdev has a chance to set up the I/O channel/do other
>> house-keeping for
>> > the plugged base bdev on each vbdev descriptor/channel open at the
>> moment of
>> > the base bdev insertion.
>>
>> You need a mechanism such that on hot-insert a message is sent to each
>> existing
>> I/O channel for the bdev to perform per-channel initialization? Can you
>> just
>> call spdk_for_each_channel?
>>
>
> Right on the spot :).
>
>
>>
>> >
>> > 4. Vbdev shutdown
>> >
>> > It appears that, while bdev subsystem start-up proceeds in the expected
>> > bottom-up fashion, with vbdevs instantiated as the underlying base
>> bdevs show
>> > up, the reverse is not true: on bdev subsystem shutdown, I see vbdev's
>> > .hotremove being called where I would expect vbdev being
>> closed/unregistered.
>> >
>> > Understandably, for a vbdev module author it would be very helpful to
>> be able
>> > to differentiate between planned (sub)system shutdown and hot removal
>> of a
>> > base bdev at run time; for this to happen, bdev subsystem shutdown
>> should
>> > proceed top-down, with virtual bdevs unregistered prior to the
>> underlying
>> > bdevs.
>>
>> I agree - Pawel Wodkowski is working in this area.
>>
>
> Just as a suggestion, below is what I arrived at re this specific subject.
>
> *Bdev subsystem init/shutdown*
>
> - While bdev layer currently provides init_complete hook, for bdevs
> interested in taking any special action once bdev subsystem initialization
> is done (such as avoiding device assembly until all present base bdevs have
> been examined), that does not seem to be of much help as there is no way
> for the bdev module to check if its examine method is being called during
> subsystem initialization or at run-time (which are two completely different
> scenarios from vbdev's author standpoint).
>
> If we had something like spdk_bdev_subsustem_init_in_progress() that would
> allow bdev module to check that in its examine method, it could then take
> actions as appropriate for either init or run-time hot-plug scenarios.
>
>
> - Bdev subsystem shutdown, IMO, could use an update similar to
> spdk_bdev_next_leaf() (though based on bdev->vbdevs) that would make it
> proceed in the top-down fashion, with bdev graph walked via bdev->vbdevs
> paths and shutdown then initiated by bdev_unregister iterator walking the
> graph from top-level vbdevs down to base bdevs. That would let virtual bdev
> module rely on the assumption that regular shutdown does not involve
> base_bdev_hotremove being called, with the latter then reserved for
> hot-remove run-time events.
>
>
>> I also wanted to mention that a few patches have gone in which allow the
>> lvol
>> bdev module to perform its examine without write access. At least one
>> more patch
>> is required still, but once complete we can merge your patch that
>> separates
>> claiming bdevs from opening them.
>>
>
> That's definitely a good news.
>
> Thanks,
> Andrey
>
>>
>> Once that is done, we need to begin work to differentiate the various
>> reasons a
>> bdev could be examined and the various reasons a bdev could be removed.
>>
>> Thanks,
>> Ben
>>
>> _______________________________________________
>> SPDK mailing list
>> SPDK(a)lists.01.org
>> https://lists.01.org/mailman/listinfo/spdk
>>
>
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 11288 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [SPDK] Dynamic base bdev management for multi-tenant virtual bdev
@ 2018-06-20 19:03 Andrey Kuzmin
0 siblings, 0 replies; 6+ messages in thread
From: Andrey Kuzmin @ 2018-06-20 19:03 UTC (permalink / raw)
To: spdk
[-- Attachment #1: Type: text/plain, Size: 8574 bytes --]
Hi Ben,
glad to see this moving forward.
On Wed, Jun 20, 2018 at 8:24 PM Walker, Benjamin <benjamin.walker(a)intel.com>
wrote:
> Hi Andrey,
>
> I'm trying to get back to some messages that slipped through the cracks. I
> think
> what you're doing here is important and needs to be addressed. Responses
> inline.
>
You've actually caught me up in the process of writing a status update
email which, to make the long story short, is very much inline with what
you write below.
With some cosmetic changes (mostly related to vbdev->base_bdevs and
bdev->vbdevs run-time management), I was able to get a multi-tenant vbdev
properly handle its base bdev's hot-plug/remove events. The major
ingredient of the spdk bdev layer infrastructure I was missing is the
channel iterator that proved to be the key to safely disabling/enabling
channels for the base bdev being removed/added. Other than that, the only
truly missing ting was just the base bdev addition under vbdev->base_bdevs
at run-time and some minor extras (which I can turn into a specific patch
and submit for review), so bdev layer has basically proven me wrong. The
item standing out is bdev subsystem initialization/shutdown, more on this
inline below.
>
> On Thu, 2018-05-31 at 14:16 +0300, Andrey Kuzmin wrote:
> > Planning for a multi-tenant virtual bdev driver, I looked into the
> provided
> > base bdev management capabilities and found them short of what I need.
> The
> > issues I see are outlined below. Let me know if the analysis is correct
> and,
> > if yes, are there any plans to provide for the dynamic base bdev
> management
> > capabilities in the multi-tenant vbdev use case.
> >
> > 1. Vbdev startup
> >
> > spdk_vbdev_register at present allows one to register a completely
> assembled
> > vbdev (with all base bdevs already examined) only. The root cause behind
> that
> > fully-assembled requirement above is spdk_vbdev_set_base_bdevs call that
> > follows, which assumes that vbdev's base bdevs haven't been set up yet.
> >
> > Apparently, a non-trivial multi-tenant vbdev should be allowed to start
> up in
> > a partially assembled state; erasure code-based RAID provides a
> ready-made
> > example of a vbdev that is expected to be/remain operational while an
> > arbitrary number of base bdevs is missing permanently or temporarily, in
> > particular (but not limited to) at startup time.
> >
> > Furthermore, a vbdev like this should be able to register a hot-plugged
> base
> > bdev at any point of runtime, yet again pointing to the need for a
> > vbdev_register_base_bdev(vbdev, base_bdev) call in addition to/in
> replacement
> > of the available spdk_vbdev_set_base_bdevs method (more on this under
> Bdev hot
> > plug below).
>
> I agree that bdev modules should be able to expose bdevs that are only
> partially
> assembled and at run time add or remove base bdevs as necessary. I also
> agree
> that the vbdev_* API has a lot of assumptions about when the base bdevs are
> known, and that is not going to work for you. However, the vbdev_* APIs are
> convenience wrappers only. You can perform every required operation in a
> bdev
> module without using those, and I think that's what you're going to want
> to do
> here. I think we need to audit the bdev module API and clarify which
> operations
> are the "fundamental" ones and which are these convenience vbdev things
> that
> work for 90% of vbdevs but not all of them. Since you sent this note, I've
> created a public header file that is intended to define the bdev module API
> officially (include/spdk/bdev_module.h). Now we just need to iterate on
> that to
> make it clearer.
>
Yes, I noticed this one.
>
> >
> > 2. Bdev surprise removal
> >
> > SPDK bdev ops vector includes .hotremove method which, for each open
> base bdev
> > descriptor, gives vbdev module an opportunity to clean up and/or do any
> > redundancy-related base bdev management.
> >
> > While .hotremove provides for the vbdev-internal bdev management on hot
> > remove, spdk_bdev_unregister which completes hot-remove handling in the
> bdev
> > layer does not remove base bdev from vbdev's base bdev list, so base
> bdev in
> > question still sits on the list after being removed. The reason is
> likely the
> > missing vbdev->base_bdevs dynamic management in general and
> > vbdev_remove_base_bdev(vbdev, bdev) call in particular, required to
> manage
> > vbdev->base_bdevs list on a single bdev removal.
>
> Agreed - the vbdev wrappers need to either be improved, or you need to use
> the
> lower level APIs.
>
I have a patch for this specifically.
> >
> > 3 Bdev hot plug
> >
> > At present virtual bdev design does seem to provide any support for base
> bdev
> > hot-plug. Vbdev's extant .examine method seems to be geared toward
> initial
> > vbdev setup in that it assumes no open vbdev descriptors (so that vbdev
> to
> > base bdevs descriptor linkage occurs when vbdev is subsequently opened
> and its
> > I/O channels are created).
> >
> > There is currently no .hotplug mechanism complementary to .hotremove that
> > would propagate base bdev insertion throughout all open vbdev
> descriptors, so
> > that vbdev has a chance to set up the I/O channel/do other house-keeping
> for
> > the plugged base bdev on each vbdev descriptor/channel open at the
> moment of
> > the base bdev insertion.
>
> You need a mechanism such that on hot-insert a message is sent to each
> existing
> I/O channel for the bdev to perform per-channel initialization? Can you
> just
> call spdk_for_each_channel?
>
Right on the spot :).
>
> >
> > 4. Vbdev shutdown
> >
> > It appears that, while bdev subsystem start-up proceeds in the expected
> > bottom-up fashion, with vbdevs instantiated as the underlying base bdevs
> show
> > up, the reverse is not true: on bdev subsystem shutdown, I see vbdev's
> > .hotremove being called where I would expect vbdev being
> closed/unregistered.
> >
> > Understandably, for a vbdev module author it would be very helpful to be
> able
> > to differentiate between planned (sub)system shutdown and hot removal of
> a
> > base bdev at run time; for this to happen, bdev subsystem shutdown should
> > proceed top-down, with virtual bdevs unregistered prior to the underlying
> > bdevs.
>
> I agree - Pawel Wodkowski is working in this area.
>
Just as a suggestion, below is what I arrived at re this specific subject.
*Bdev subsystem init/shutdown*
- While bdev layer currently provides init_complete hook, for bdevs
interested in taking any special action once bdev subsystem initialization
is done (such as avoiding device assembly until all present base bdevs have
been examined), that does not seem to be of much help as there is no way
for the bdev module to check if its examine method is being called during
subsystem initialization or at run-time (which are two completely different
scenarios from vbdev's author standpoint).
If we had something like spdk_bdev_subsustem_init_in_progress() that would
allow bdev module to check that in its examine method, it could then take
actions as appropriate for either init or run-time hot-plug scenarios.
- Bdev subsystem shutdown, IMO, could use an update similar to
spdk_bdev_next_leaf() (though based on bdev->vbdevs) that would make it
proceed in the top-down fashion, with bdev graph walked via bdev->vbdevs
paths and shutdown then initiated by bdev_unregister iterator walking the
graph from top-level vbdevs down to base bdevs. That would let virtual bdev
module rely on the assumption that regular shutdown does not involve
base_bdev_hotremove being called, with the latter then reserved for
hot-remove run-time events.
> I also wanted to mention that a few patches have gone in which allow the
> lvol
> bdev module to perform its examine without write access. At least one more
> patch
> is required still, but once complete we can merge your patch that separates
> claiming bdevs from opening them.
>
That's definitely a good news.
Thanks,
Andrey
>
> Once that is done, we need to begin work to differentiate the various
> reasons a
> bdev could be examined and the various reasons a bdev could be removed.
>
> Thanks,
> Ben
>
> _______________________________________________
> SPDK mailing list
> SPDK(a)lists.01.org
> https://lists.01.org/mailman/listinfo/spdk
>
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 10628 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [SPDK] Dynamic base bdev management for multi-tenant virtual bdev
@ 2018-05-31 19:12 Andrey Kuzmin
0 siblings, 0 replies; 6+ messages in thread
From: Andrey Kuzmin @ 2018-05-31 19:12 UTC (permalink / raw)
To: spdk
[-- Attachment #1: Type: text/plain, Size: 6774 bytes --]
On Thu, May 31, 2018, 20:20 Luse, Paul E <paul.e.luse(a)intel.com> wrote:
> Hi Andrey,
>
>
>
> A few questions/comments below, I’m sure you’ll get more going on this
> thread as well - good stuff!! I assume you are working on a more complex
> vbdev module than what the community has provided for in examples, the more
> you can share about what you’re working on the better (to the extent that
> you can of course).
>
>
>
> I can see a lot of really great improvements coming out of this thread and
> your work - do you have plans to push some patches to address some of the
> shortcomings?
>
If I have indeed spotted an area worth improvement, I'd be glad to work on
this. Just didn't want to jump into a wagon already moving.
>
>
> -Paul
>
>
>
> *From:* SPDK [mailto:spdk-bounces(a)lists.01.org] *On Behalf Of *Andrey
> Kuzmin
> *Sent:* Thursday, May 31, 2018 4:17 AM
> *To:* Storage Performance Development Kit <spdk(a)lists.01.org>
> *Subject:* [SPDK] Dynamic base bdev management for multi-tenant virtual
> bdev
>
>
>
> Planning for a multi-tenant virtual bdev driver, I looked into the
> provided base bdev management capabilities and found them short of what I
> need. The issues I see are outlined below. Let me know if the analysis is
> correct and, if yes, are there any plans to provide for the dynamic base
> bdev management capabilities in the multi-tenant vbdev use case.
>
> In general if you don’t see it on https://trello.com/b/LnORPCpt/bdev (or
> the relevant board for the topic/module in question) it’s probably safe to
> assume that there’s not much going on wrt whatever the specific topic is.
>
>
>
>
> 1. Vbdev startup
>
> spdk_vbdev_register at present allows one to register a completely
> assembled vbdev (with all base bdevs already examined) only. The root cause
> behind that fully-assembled requirement above is spdk_vbdev_set_base_bdevs
> call that follows, which assumes that vbdev's base bdevs haven't been set
> up yet.
>
>
>
> PL> I think this is really left up to the developer of the module to
> decide when to register in terms of whether is fully assembled or not.
> Recently a callback was added to let the vbdev module know when all the
> power on init examines() are done so that at least a RAID-like vbdev would
> be able to make an informed decision during that callback instead of in
> examine() when it doesn’t really know if something is coming next or not.
> Were you aware of this and does it address your specific concern? It
> doesn’t mean that you can register a vbdev w/o one of the base bdevs being
> present but lets you register it later when you know what is and isn’t
> present you could register one w ¾ of the bdev’s there for example in a
> RAID case.
>
That sounds like a nice workaround for the startup case, but it doesn't
address other concerns as there's is still no way to add the missing bdev
once it's up latern on, for instance after being physically replaced
(pretty much a standard scenario for a storage system).
>
> Apparently, a non-trivial multi-tenant vbdev should be allowed to start up
> in a partially assembled state; erasure code-based RAID provides a
> ready-made example of a vbdev that is expected to be/remain operational
> while an arbitrary number of base bdevs is missing permanently or
> temporarily, in particular (but not limited to) at startup time.
>
> PL> Having not implemented a non-trivial multi-tenant vbdev, I’m not sure
> if I’m prev comment covers this or not J I could, however see, an
> implementation there somnoe a base_bdev could be specific as a placeholder
>
>
> Furthermore, a vbdev like this should be able to register a hot-plugged
> base bdev at any point of runtime, yet again pointing to the need for a
> vbdev_register_base_bdev(vbdev, base_bdev) call in addition to/in
> replacement of the available spdk_vbdev_set_base_bdevs method (more on this
> under Bdev hot plug below).
>
> PL> Sure, where the hot-added base bdev either replaces a
> placeholder/missing bdev or is simply an expansion or something?
>
I didn't consider the expansion case as I'd like first to see if we can
reasonably deal with a standad drive lost/replaced case, although it's
worth keeping in mind.
>
> 2. Bdev surprise removal
>
> SPDK bdev ops vector includes .hotremove method which, for each open base
> bdev descriptor, gives vbdev module an opportunity to clean up and/or do
> any redundancy-related base bdev management.
>
> While .hotremove provides for the vbdev-internal bdev management on hot
> remove, spdk_bdev_unregister which completes hot-remove handling in the
> bdev layer does not remove base bdev from vbdev's base bdev list, so base
> bdev in question still sits on the list after being removed. The reason is
> likely the missing vbdev->base_bdevs dynamic management in general and
> vbdev_remove_base_bdev(vbdev, bdev) call in particular, required to manage
> vbdev->base_bdevs list on a single bdev removal.
>
> 3 Bdev hot plug
>
> At present virtual bdev design does seem to provide any support for base
> bdev hot-plug. Vbdev's extant .examine method seems to be geared toward
> initial vbdev setup in that it assumes no open vbdev descriptors (so that
> vbdev to base bdevs descriptor linkage occurs when vbdev is subsequently
> opened and its I/O channels are created).
>
>
>
> There is currently no .hotplug mechanism complementary to .hotremove that
> would propagate base bdev insertion throughout all open vbdev descriptors,
> so that vbdev has a chance to set up the I/O channel/do other house-keeping
> for the plugged base bdev on each vbdev descriptor/channel open at the
> moment of the base bdev insertion.
>
>
>
> PL> I’m not aware of anything like this either
>
And it sounds like a hard requirement to me.
Regards,
A.
>
>
> 4. Vbdev shutdown
>
> It appears that, while bdev subsystem start-up proceeds in the expected
> bottom-up fashion, with vbdevs instantiated as the underlying base bdevs
> show up, the reverse is not true: on bdev subsystem shutdown, I see vbdev's
> .hotremove being called where I would expect vbdev being
> closed/unregistered.
>
> Understandably, for a vbdev module author it would be very helpful to be
> able to differentiate between planned (sub)system shutdown and hot removal
> of a base bdev at run time; for this to happen, bdev subsystem shutdown
> should proceed top-down, with virtual bdevs unregistered prior to the
> underlying bdevs.
>
>
>
> Regards,
> Andrey
> _______________________________________________
> SPDK mailing list
> SPDK(a)lists.01.org
> https://lists.01.org/mailman/listinfo/spdk
>
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 12532 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [SPDK] Dynamic base bdev management for multi-tenant virtual bdev
@ 2018-05-31 17:20 Luse, Paul E
0 siblings, 0 replies; 6+ messages in thread
From: Luse, Paul E @ 2018-05-31 17:20 UTC (permalink / raw)
To: spdk
[-- Attachment #1: Type: text/plain, Size: 5551 bytes --]
Hi Andrey,
A few questions/comments below, I’m sure you’ll get more going on this thread as well - good stuff!! I assume you are working on a more complex vbdev module than what the community has provided for in examples, the more you can share about what you’re working on the better (to the extent that you can of course).
I can see a lot of really great improvements coming out of this thread and your work - do you have plans to push some patches to address some of the shortcomings?
-Paul
From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of Andrey Kuzmin
Sent: Thursday, May 31, 2018 4:17 AM
To: Storage Performance Development Kit <spdk(a)lists.01.org>
Subject: [SPDK] Dynamic base bdev management for multi-tenant virtual bdev
Planning for a multi-tenant virtual bdev driver, I looked into the provided base bdev management capabilities and found them short of what I need. The issues I see are outlined below. Let me know if the analysis is correct and, if yes, are there any plans to provide for the dynamic base bdev management capabilities in the multi-tenant vbdev use case.
In general if you don’t see it on https://trello.com/b/LnORPCpt/bdev (or the relevant board for the topic/module in question) it’s probably safe to assume that there’s not much going on wrt whatever the specific topic is.
1. Vbdev startup
spdk_vbdev_register at present allows one to register a completely assembled vbdev (with all base bdevs already examined) only. The root cause behind that fully-assembled requirement above is spdk_vbdev_set_base_bdevs call that follows, which assumes that vbdev's base bdevs haven't been set up yet.
PL> I think this is really left up to the developer of the module to decide when to register in terms of whether is fully assembled or not. Recently a callback was added to let the vbdev module know when all the power on init examines() are done so that at least a RAID-like vbdev would be able to make an informed decision during that callback instead of in examine() when it doesn’t really know if something is coming next or not. Were you aware of this and does it address your specific concern? It doesn’t mean that you can register a vbdev w/o one of the base bdevs being present but lets you register it later when you know what is and isn’t present you could register one w ¾ of the bdev’s there for example in a RAID case.
Apparently, a non-trivial multi-tenant vbdev should be allowed to start up in a partially assembled state; erasure code-based RAID provides a ready-made example of a vbdev that is expected to be/remain operational while an arbitrary number of base bdevs is missing permanently or temporarily, in particular (but not limited to) at startup time.
PL> Having not implemented a non-trivial multi-tenant vbdev, I’m not sure if I’m prev comment covers this or not ☺ I could, however see, an implementation there somnoe a base_bdev could be specific as a placeholder
Furthermore, a vbdev like this should be able to register a hot-plugged base bdev at any point of runtime, yet again pointing to the need for a vbdev_register_base_bdev(vbdev, base_bdev) call in addition to/in replacement of the available spdk_vbdev_set_base_bdevs method (more on this under Bdev hot plug below).
PL> Sure, where the hot-added base bdev either replaces a placeholder/missing bdev or is simply an expansion or something?
2. Bdev surprise removal
SPDK bdev ops vector includes .hotremove method which, for each open base bdev descriptor, gives vbdev module an opportunity to clean up and/or do any redundancy-related base bdev management.
While .hotremove provides for the vbdev-internal bdev management on hot remove, spdk_bdev_unregister which completes hot-remove handling in the bdev layer does not remove base bdev from vbdev's base bdev list, so base bdev in question still sits on the list after being removed. The reason is likely the missing vbdev->base_bdevs dynamic management in general and vbdev_remove_base_bdev(vbdev, bdev) call in particular, required to manage vbdev->base_bdevs list on a single bdev removal.
3 Bdev hot plug
At present virtual bdev design does seem to provide any support for base bdev hot-plug. Vbdev's extant .examine method seems to be geared toward initial vbdev setup in that it assumes no open vbdev descriptors (so that vbdev to base bdevs descriptor linkage occurs when vbdev is subsequently opened and its I/O channels are created).
There is currently no .hotplug mechanism complementary to .hotremove that would propagate base bdev insertion throughout all open vbdev descriptors, so that vbdev has a chance to set up the I/O channel/do other house-keeping for the plugged base bdev on each vbdev descriptor/channel open at the moment of the base bdev insertion.
PL> I’m not aware of anything like this either
4. Vbdev shutdown
It appears that, while bdev subsystem start-up proceeds in the expected bottom-up fashion, with vbdevs instantiated as the underlying base bdevs show up, the reverse is not true: on bdev subsystem shutdown, I see vbdev's .hotremove being called where I would expect vbdev being closed/unregistered.
Understandably, for a vbdev module author it would be very helpful to be able to differentiate between planned (sub)system shutdown and hot removal of a base bdev at run time; for this to happen, bdev subsystem shutdown should proceed top-down, with virtual bdevs unregistered prior to the underlying bdevs.
Regards,
Andrey
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 10817 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [SPDK] Dynamic base bdev management for multi-tenant virtual bdev
@ 2018-05-31 11:16 Andrey Kuzmin
0 siblings, 0 replies; 6+ messages in thread
From: Andrey Kuzmin @ 2018-05-31 11:16 UTC (permalink / raw)
To: spdk
[-- Attachment #1: Type: text/plain, Size: 3441 bytes --]
Planning for a multi-tenant virtual bdev driver, I looked into the provided
base bdev management capabilities and found them short of what I need. The
issues I see are outlined below. Let me know if the analysis is correct
and, if yes, are there any plans to provide for the dynamic base bdev
management capabilities in the multi-tenant vbdev use case.
1. Vbdev startup
spdk_vbdev_register at present allows one to register a completely
assembled vbdev (with all base bdevs already examined) only. The root cause
behind that fully-assembled requirement above is spdk_vbdev_set_base_bdevs
call that follows, which assumes that vbdev's base bdevs haven't been set
up yet.
Apparently, a non-trivial multi-tenant vbdev should be allowed to start up
in a partially assembled state; erasure code-based RAID provides a
ready-made example of a vbdev that is expected to be/remain operational
while an arbitrary number of base bdevs is missing permanently or
temporarily, in particular (but not limited to) at startup time.
Furthermore, a vbdev like this should be able to register a hot-plugged
base bdev at any point of runtime, yet again pointing to the need for a
vbdev_register_base_bdev(vbdev, base_bdev) call in addition to/in
replacement of the available spdk_vbdev_set_base_bdevs method (more on this
under Bdev hot plug below).
2. Bdev surprise removal
SPDK bdev ops vector includes .hotremove method which, for each open base
bdev descriptor, gives vbdev module an opportunity to clean up and/or do
any redundancy-related base bdev management.
While .hotremove provides for the vbdev-internal bdev management on hot
remove, spdk_bdev_unregister which completes hot-remove handling in the
bdev layer does not remove base bdev from vbdev's base bdev list, so base
bdev in question still sits on the list after being removed. The reason is
likely the missing vbdev->base_bdevs dynamic management in general and
vbdev_remove_base_bdev(vbdev, bdev) call in particular, required to manage
vbdev->base_bdevs list on a single bdev removal.
3 Bdev hot plug
At present virtual bdev design does seem to provide any support for base
bdev hot-plug. Vbdev's extant .examine method seems to be geared toward
initial vbdev setup in that it assumes no open vbdev descriptors (so that
vbdev to base bdevs descriptor linkage occurs when vbdev is subsequently
opened and its I/O channels are created).
There is currently no .hotplug mechanism complementary to .hotremove that
would propagate base bdev insertion throughout all open vbdev descriptors,
so that vbdev has a chance to set up the I/O channel/do other house-keeping
for the plugged base bdev on each vbdev descriptor/channel open at the
moment of the base bdev insertion.
4. Vbdev shutdown
It appears that, while bdev subsystem start-up proceeds in the expected
bottom-up fashion, with vbdevs instantiated as the underlying base bdevs
show up, the reverse is not true: on bdev subsystem shutdown, I see vbdev's
.hotremove being called where I would expect vbdev being
closed/unregistered.
Understandably, for a vbdev module author it would be very helpful to be
able to differentiate between planned (sub)system shutdown and hot removal
of a base bdev at run time; for this to happen, bdev subsystem shutdown
should proceed top-down, with virtual bdevs unregistered prior to the
underlying bdevs.
Regards,
Andrey
[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 3979 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-06-20 20:18 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-20 17:24 [SPDK] Dynamic base bdev management for multi-tenant virtual bdev Walker, Benjamin
-- strict thread matches above, loose matches on Subject: below --
2018-06-20 20:18 Andrey Kuzmin
2018-06-20 19:03 Andrey Kuzmin
2018-05-31 19:12 Andrey Kuzmin
2018-05-31 17:20 Luse, Paul E
2018-05-31 11:16 Andrey Kuzmin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox