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: <2acfe69f-f542-4f74-b671-d5a952d5b205@pankajraghav.com>
Date: Mon, 2 Jun 2025 17:34:27 +0200
From: Pankaj Raghav <kernel@...kajraghav.com>
To: Christoph Hellwig <hch@....de>, Pankaj Raghav <p.raghav@...sung.com>
Cc: Suren Baghdasaryan <surenb@...gle.com>,
 Ryan Roberts <ryan.roberts@....com>, Vlastimil Babka <vbabka@...e.cz>,
 Baolin Wang <baolin.wang@...ux.alibaba.com>, Borislav Petkov <bp@...en8.de>,
 Ingo Molnar <mingo@...hat.com>, "H . Peter Anvin" <hpa@...or.com>,
 Zi Yan <ziy@...dia.com>, Mike Rapoport <rppt@...nel.org>,
 Dave Hansen <dave.hansen@...ux.intel.com>, Michal Hocko <mhocko@...e.com>,
 David Hildenbrand <david@...hat.com>,
 Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
 Andrew Morton <akpm@...ux-foundation.org>,
 Thomas Gleixner <tglx@...utronix.de>, Nico Pache <npache@...hat.com>,
 Dev Jain <dev.jain@....com>, "Liam R . Howlett" <Liam.Howlett@...cle.com>,
 Jens Axboe <axboe@...nel.dk>, linux-kernel@...r.kernel.org,
 linux-mm@...ck.org, linux-block@...r.kernel.org, willy@...radead.org,
 x86@...nel.org, linux-fsdevel@...r.kernel.org,
 "Darrick J . Wong" <djwong@...nel.org>, mcgrof@...nel.org,
 gost.dev@...sung.com
Subject: Re: [RFC 3/3] block: use mm_huge_zero_folio in
 __blkdev_issue_zero_pages()

On 6/2/25 07:05, Christoph Hellwig wrote:
> On Tue, May 27, 2025 at 07:04:52AM +0200, Pankaj Raghav wrote:
>> Noticed a 4% increase in performance on a commercial NVMe SSD which does
>> not support OP_WRITE_ZEROES. The device's MDTS was 128K. The performance
>> gains might be bigger if the device supports bigger MDTS.
> 
> Impressive gain on the one hand - on the other hand what is the macro
> workload that does a lot of zeroing on an SSD, because avoiding that
> should yield even better result while reducing wear..
> 

Absolutely. I think it is better to use either WRITE_ZEROES or DISCARD. But I wanted
to have some measurable workload to show the benefits of using a huge page to zero out.

Interestingly, I have seen many client SSDs not implementing WRITE_ZEROES.

>> +			unsigned int len, added = 0;
>>  
>> +			len = min_t(sector_t, folio_size(zero_folio),
>> +				    nr_sects << SECTOR_SHIFT);
>> +			if (bio_add_folio(bio, zero_folio, len, 0))
>> +				added = len;
>>  			if (added < len)
>>  				break;
>>  			nr_sects -= added >> SECTOR_SHIFT;
> 
> Unless I'm missing something the added variable can go away now, and
> the code using it can simply use len.
> 

Yes. This should do it.

if (!bio_add_folio(bio, zero_folio, len, 0))
    break;

nr_sects -= len >> SECTOR_SHIFT;

--
Pankaj

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ