lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <76850f4f-0bd0-48ae-92f4-e3af38039938@oracle.com>
Date: Mon, 3 Jun 2024 14:29:26 +0100
From: John Garry <john.g.garry@...cle.com>
To: Hannes Reinecke <hare@...e.de>, axboe@...nel.dk, kbusch@...nel.org,
        hch@....de, sagi@...mberg.me, jejb@...ux.ibm.com,
        martin.petersen@...cle.com, djwong@...nel.org, viro@...iv.linux.org.uk,
        brauner@...nel.org, dchinner@...hat.com, jack@...e.cz
Cc: 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,
        Himanshu Madhani <himanshu.madhani@...cle.com>
Subject: Re: [PATCH v7 4/9] block: Add core atomic write support

On 03/06/2024 13:31, Hannes Reinecke wrote:
>>
>> It seems ok in principle - we would just need to ensure that it is 
>> watertight.
>>
> 
> We currently use chunk_sectors for quite some different things, most 
> notably zones boundaries, NIOIB, raid stripes etc.
> So I don't have an issue adding another use-case for it.
> 
>>> Q2: If we don't, shouldn't we align the atomic write boundary to the 
>>> chunk_sectors setting to ensure both match up?
>>
>> Yeah, right. But we can only handle what HW tells.
>>
>> The atomic write boundary is only relevant to NVMe. NVMe NOIOB - which 
>> we use to set chunk_sectors - is an IO optimization hint, AFAIK. 
>> However the atomic write boundary is a hard limit. So if NOIOB is not 
>> aligned with the atomic write boundary - which seems unlikely - then 
>> the atomic write boundary takes priority.
>>
> Which is what I said; we need to check. And I would treat a NOIOB value 
> not aligned to the atomic write boundary as an error.

Yeah, maybe we can reject that in blk_validate_limits(), by error'ing or 
disabling atomic writes there.

> 
> But the real issue here is that the atomic write boundary only matters
> for requests, and not for the entire queue.
> So using chunk_sectors is out of question as this would affect all 
> requests, and my comment was actually wrong.
> I'll retract it.

I think that some of the logic could be re-used. 
rq_straddles_atomic_write_boundary() is checked in merging of reqs/bios 
(to see if the resultant req straddles a boundary).

So instead of saying: "will the resultant req straddle a boundary", 
re-using path like blk_rq_get_max_sectors() -> blk_chunk_sectors_left(), 
we check "is there space within the boundary limit to add this req/bio". 
We need to take care of front and back merges, though.

Thanks,
John



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ