Re: [PATCH 00/26] DCD: Add support for Dynamic Capacity Devices (DCD)

From: Jonathan Cameron
Date: Wed Apr 03 2024 - 16:45:10 EST


On Wed, 27 Mar 2024 22:20:45 -0700
Ira Weiny <ira.weiny@xxxxxxxxx> wrote:

> fan wrote:
> > On Sun, Mar 24, 2024 at 04:18:03PM -0700, ira.weiny@xxxxxxxxx wrote:
> > > A git tree of this series can be found here:
>
> [snip]
>
> > >
> >
> > Hi Ira,
> > Have not got a chance to check the code yet, but I noticed one thing
> > when testing with my DCD emulation code.
> > Currently, if we do partial release, it seems the whole extent will be
> > removed. Is it designed intentionally?
> >
>
> Yes that is my intent. I specifically called that out in patch 18.
>
> https://lore.kernel.org/all/20240324-dcd-type2-upstream-v1-18-b7b00d623625@xxxxxxxxx/
>
> I thought we discussed this in one of the collaboration calls. Mainly
> this is to simplify by not attempting any split of the extents the host is
> tracking. It really is expected that the FM/device is going to keep those
> extents offered and release them in their entirety. I understand this may
> complicate the device because it may see a release of memory prior to the
> request of that release. And perhaps this complicates the device. But in
> that case it (or the FM really) should not attempt to release partial
> extents.

It was discussed at some point as you say. Feels like something that might not
be set in stone for ever, but for now it is a reasonable simplifying assumption.
The device might not maintain the separation of neighboring extents
but the FM probably will. If it turns out real use models are different,
then we 'guessed' wrong and get to write more complex code.

Device always has to cope with unsolicited release so don't think this adds
any burden. That includes a race where the host releases capacity when
it hasn't yet seen the event the device has sent to release part of the same
capacity. There is text about async release always being possible in the
spec to cover these overlapping cases but upshot of that one is it must be
permissible to release a containing capacity as you are doing.

Jonathan

> Ira
>
> [snip]