Re: Persistent Reservation API V2

2015-08-21 Thread Christoph Hellwig
On Thu, Aug 20, 2015 at 11:56:36PM +, Keith Busch wrote:

> NVMe can also specify
> if whether or not a reservation should persist through power-loss.

SCSI does as well, it's the APTPL flag.  However reservations not persistent
through a power loss are basically useless, so I decided to force them on
in the API.  From the documentation:

"All implementations are expected to ensure the reservations survive
 a power loss"

So I would prefer not to add it, or if we really have to as a negative flag
to specifically opt out of the APTPL behavior.

> with it. For example, NVMe can ignore existing keys when acquiring a
> reservation in addition to registering a new key.

This sounds like a sensible addition to me, and I wouldn't be surprised
if future SPC versions will add this flag.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Persistent Reservation API V2

2015-08-20 Thread Keith Busch

On Tue, 11 Aug 2015, Christoph Hellwig wrote:

This series adds support for a simplified Persistent Reservation API
to the block layer.  The intent is that both in-kernel and userspace
consumers can use the API instead of having to hand craft SCSI or NVMe
command through the various pass through interfaces.  It also adds
DM support as getting reservations through dm-multipath is a major
pain with the current scheme.

NVMe support currently isn't included as I don't have a multihost
NVMe setup to test on, but Keith offered to test it and I'll have
a patch for it shortly.


Hi Christoph,

I wrote an nvme implementation and it seems to work as expected with your
pr-tests (minor modification to open an nvme target). While API appears to
work as designed, there are a few features of NVMe that are unreachable
with it. For example, NVMe can ignore existing keys when acquiring a
reservation in addition to registering a new key. NVMe can also specify
if whether or not a reservation should persist through power-loss.

Anyway, I don't think SCSI has these same options. Should this new IOCTL
API accommodate the common subset to maintain its simplicity, or make
it more expressive for all features? The more important question might
be if there are any users requiring these features, and I honestly don't
know that right now.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Persistent Reservation API V2

2015-08-18 Thread Jens Axboe

On 08/17/2015 01:13 PM, Christoph Hellwig wrote:

Does this look fine to you Jens?

I'd love to get this API into 4.3 so I can submit the NFS SCSI layout
patches that depend on it for 4.4.



I'll take a look at this today.

--
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Persistent Reservation API V2

2015-08-17 Thread Christoph Hellwig
Does this look fine to you Jens?

I'd love to get this API into 4.3 so I can submit the NFS SCSI layout
patches that depend on it for 4.4.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Persistent Reservation API V2

2015-08-11 Thread Christoph Hellwig
This series adds support for a simplified Persistent Reservation API
to the block layer.  The intent is that both in-kernel and userspace
consumers can use the API instead of having to hand craft SCSI or NVMe
command through the various pass through interfaces.  It also adds
DM support as getting reservations through dm-multipath is a major
pain with the current scheme.

NVMe support currently isn't included as I don't have a multihost
NVMe setup to test on, but Keith offered to test it and I'll have
a patch for it shortly.

The ioctl API is documented in Documentation/block/pr.txt, but to
fully understand the concept you'll have to read up the SPC spec,
PRs are too complicated that trying to rephrase them into different
terminology is just going to create confusion.

Note that Mike wants to include the DM patches so through the DM
tree, so they are only included for reference.

I also have a set of simple test tools available at:

git://git.infradead.org/users/hch/pr-tests.git

Changes since V1:
  - rename DM ->ioctl to ->prepare_ioctl
  - rename dm_get_ioctl_table to dm_get_live_table_for_ioctl
  - merge two DM patches into one
  - various spelling fixes

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/