From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>, Nick Terrell <terrelln@fb.com>,
Chris Down <chris@chrisdown.name>,
Filipe Manana <fdmanana@suse.com>, Qu Wenruo <wqu@suse.com>,
Nikolay Borisov <nborisov@suse.com>,
Gabriel Niebler <gniebler@suse.com>,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Ira Weiny <ira.weiny@intel.com>
Subject: Re: [RFC PATCH] btrfs: Replace kmap() with kmap_local_page() in zlib.c
Date: Fri, 17 Jun 2022 14:18:23 +0200 [thread overview]
Message-ID: <2243807.ElGaqSPkdT@opensuse> (raw)
In-Reply-To: <20220614104718.9193-1-fmdefrancesco@gmail.com>
On martedì 14 giugno 2022 12:47:18 CEST Fabio M. De Francesco wrote:
> The use of kmap() is being deprecated in favor of kmap_local_page(). With
> kmap_local_page(), the mapping is per thread, CPU local and not globally
> visible.
>
> Therefore, use kmap_local_page() / kunmap_local() in zlib.c because in
> this file the mappings are per thread and are not visible in other
> contexts; meanwhile refactor zlib_compress_pages() to comply with nested
> local mapping / unmapping ordering rules.
>
> Tested with xfstests on QEMU + KVM 32 bits VM with 4GB of RAM and
> HIGHMEM64G enabled.
>
> This is an RFC PATCH because it passes all tests of the "compress"
> group, with the only two exceptions of tests/btrfs/138 (it freezes the
> VM) and tests/btrfs/251 (it runs forever but doesn't freeze the VM).
>
> Can anyone please take a look and tell me what I'm still overlooking
> after days of code inspections?
>
> Suggested-by: Ira Weiny <ira.weiny@intel.com>
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> ---
> fs/btrfs/zlib.c | 75 ++++++++++++++++++++++++++++++++-----------------
> 1 file changed, 50 insertions(+), 25 deletions(-)
>
Please don't respond to this RFC and drop it. I've just split it into three
new versions and send a series of RFC PATCH(es) which seems to work
properly.
They can pass all tests of the group "compress", but I decided to implement
some questionable solutions. Therefore, I'd like to hear about them:
https://lore.kernel.org/lkml/20220617120538.18091-1-fmdefrancesco@gmail.com/T/#t
Thanks,
Fabio
prev parent reply other threads:[~2022-06-17 12:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-14 10:47 [RFC PATCH] btrfs: Replace kmap() with kmap_local_page() in zlib.c Fabio M. De Francesco
2022-06-14 14:13 ` Ira Weiny
2022-06-17 12:18 ` Fabio M. De Francesco [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2243807.ElGaqSPkdT@opensuse \
--to=fmdefrancesco@gmail.com \
--cc=chris@chrisdown.name \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=fdmanana@suse.com \
--cc=gniebler@suse.com \
--cc=ira.weiny@intel.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nborisov@suse.com \
--cc=terrelln@fb.com \
--cc=wqu@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox