[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <141c769a-1642-424c-bae1-1d19441a115a@suse.de>
Date: Fri, 21 Jun 2024 08:15:58 +0200
From: Hannes Reinecke <hare@...e.de>
To: John Garry <john.g.garry@...cle.com>, axboe@...nel.dk, kbusch@...nel.org,
hch@....de, sagi@...mberg.me, jejb@...ux.ibm.com,
martin.petersen@...cle.com, viro@...iv.linux.org.uk, brauner@...nel.org,
dchinner@...hat.com, jack@...e.cz
Cc: djwong@...nel.org, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-nvme@...ts.infradead.org,
linux-fsdevel@...r.kernel.org, tytso@....edu, jbongio@...gle.com,
linux-scsi@...r.kernel.org, ojaswin@...ux.ibm.com, linux-aio@...ck.org,
linux-btrfs@...r.kernel.org, io-uring@...r.kernel.org, nilay@...ux.ibm.com,
ritesh.list@...il.com, willy@...radead.org, agk@...hat.com,
snitzer@...nel.org, mpatocka@...hat.com, dm-devel@...ts.linux.dev
Subject: Re: [Patch v9 09/10] scsi: scsi_debug: Atomic write support
On 6/20/24 14:53, John Garry wrote:
> Add initial support for atomic writes.
>
> As is standard method, feed device properties via modules param, those
> being:
> - atomic_max_size_blks
> - atomic_alignment_blks
> - atomic_granularity_blks
> - atomic_max_size_with_boundary_blks
> - atomic_max_boundary_blks
>
> These just match sbc4r22 section 6.6.4 - Block limits VPD page.
>
> We just support ATOMIC WRITE (16).
>
> The major change in the driver is how we lock the device for RW accesses.
>
> Currently the driver uses a per-device lock for accessing device metadata
> and "media" data (calls to do_device_access()) atomically for the duration
> of the whole read/write command.
>
> This should not suit verifying atomic writes. Reason being that currently
> all reads/writes are atomic, so using atomic writes does not prove
> anything.
>
> Change device access model to basis that regular writes only atomic on a
> per-sector basis, while reads and atomic writes are fully atomic.
>
> As mentioned, since accessing metadata and device media is atomic,
> continue to have regular writes involving metadata - like discard or PI -
> as atomic. We can improve this later.
>
> Currently we only support model where overlapping going reads or writes
> wait for current access to complete before commencing an atomic write.
> This is described in 4.29.3.2 section of the SBC. However, we simplify,
> things and wait for all accesses to complete (when issuing an atomic
> write).
>
> Reviewed-by: Martin K. Petersen <martin.petersen@...cle.com>
> Signed-off-by: John Garry <john.g.garry@...cle.com>
> ---
> drivers/scsi/scsi_debug.c | 588 +++++++++++++++++++++++++++++---------
> 1 file changed, 454 insertions(+), 134 deletions(-)
>
Reviewed-by: Hannes Reinecke <hare@...e.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@...e.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
Powered by blists - more mailing lists