[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240618064907.GA29009@lst.de>
Date: Tue, 18 Jun 2024 08:49:07 +0200
From: Christoph Hellwig <hch@....de>
To: John Garry <john.g.garry@...cle.com>
Cc: Kanchan Joshi <joshi.k@...sung.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,
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,
hare@...e.de, Alan Adamson <alan.adamson@...cle.com>
Subject: Re: [PATCH v8 10/10] nvme: Atomic write support
On Mon, Jun 17, 2024 at 07:04:23PM +0100, John Garry wrote:
>> Nit: I'd cache blk_rq_bytes(req), since that is repeating and this
>> function is called for each atomic IO.
>
> blk_rq_bytes() is just a wrapper for rq->__data_len. I suppose that we
> could cache that value to stop re-reading that memory, but I would
> hope/expect that memory to be in the CPU cache anyway.
Yes, that feels a bit pointless.
> Only NVMe supports an LBA space boundary, so that part is specific to NVMe.
>
> Regardless, the block layer already should ensure that the atomic write
> length and boundary is respected. nvme_valid_atomic_write() is just an
> insurance policy against the block layer or some other component not doing
> its job.
>
> For SCSI, the device would error - for example - if the atomic write length
> was larger than the device supported. NVMe silently just does not execute
> the write atomically in that scenario, which we must avoid.
It might be worth to expand the comment to include this information to
help future readers.
Powered by blists - more mailing lists