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] [day] [month] [year] [list]
Date:   Sat, 18 Jun 2022 11:04:41 +0200
From:   "Fabio M. De Francesco" <fmdefrancesco@...il.com>
To:     Chris Mason <clm@...com>, Josef Bacik <josef@...icpanda.com>,
        David Sterba <dsterba@...e.com>,
        Nick Terrell <terrelln@...com>,
        Chris Down <chris@...isdown.name>,
        Filipe Manana <fdmanana@...e.com>, Qu Wenruo <wqu@...e.com>,
        Nikolay Borisov <nborisov@...e.com>,
        Gabriel Niebler <gniebler@...e.com>,
        Ira Weiny <ira.weiny@...el.com>, linux-btrfs@...r.kernel.org,
        linux-kernel@...r.kernel.org, Qu Wenruo <quwenruo.btrfs@....com>
Subject: Re: [RFC PATCH v2 3/3] btrfs: Use kmap_local_page() on "in_page" in zlib_compress_pages()

On sabato 18 giugno 2022 00:16:15 CEST Qu Wenruo wrote:
> 
> On 2022/6/18 02:13, Fabio M. De Francesco wrote:

[snip]

> 
> Thanks for pointing to the doc, and that doc is enough to answer my
> question.
> 

Well, this confirms that my changes were quite helpful :-)

[snip]

> > As I said in a recent email, I'm relatively new to kernel development,
> > especially to Btrfs and other filesystems.
> 
> That's not a big deal, that's why we're here to provide help.
> 
> >
> > However, I noted that this code does different handling depending 
> > on how many "in_page" is going to map. I am not able to say why...
> 
> AFAIK the reason is optimization.
> 
> The idea is like this, if there are multiple pages left as input, we
> copy the pages from page cache into the workspace buffer.
> 
> If there is no more than one page left, we use that page from page cache
> directly.
> 
> I believe that's the problem causing the difficult in converting to
> kmap_local_page().
> 

[snip]

> 
> I'll send out a cleanup for zlib_compress_pages(), mostly to make the
> (strm.avail_in == 0) branch to call kmap() and kunmap() in pairs,
> without holding @in_page mapped.
> 
> Would that make it easier?
> 

I was doubtful when you asked this question. However, when this morning I 
saw your patch, I soon understood that it would make that task so easy that 
a silly script could do a mechanical conversion.

Thanks so much,

Fabio



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ