From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: linux-nvme@lists.infradead.org, Sagi Grimberg <sagi@grimberg.me>
Cc: linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
Keith Busch <kbusch@kernel.org>,
Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>,
James Smart <james.smart@broadcom.com>,
Ira Weiny <ira.weiny@intel.com>,
Venkataramanan Anirudh <anirudh.venkataramanan@intel.com>,
Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH] nvmet-tcp: Don't map pages which can't come from HIGHMEM
Date: Tue, 30 Aug 2022 23:40:09 +0200 [thread overview]
Message-ID: <5295597.Sb9uPGUboI@opensuse> (raw)
In-Reply-To: <20220829075401.868981-1-sagi@grimberg.me>
On lunedì 29 agosto 2022 09:54:01 CEST Sagi Grimberg wrote:
> From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
>
> kmap() is being deprecated in favor of kmap_local_page().[1]
>
> There are two main problems with kmap(): (1) It comes with an overhead as
> mapping space is restricted and protected by a global lock for
> synchronization and (2) it also requires global TLB invalidation when the
> kmap’s pool wraps and it might block when the mapping space is fully
> utilized until a slot becomes available.
>
> The pages which will be mapped are allocated in nvmet_tcp_map_data(),
> using the GFP_KERNEL flag. This assures that they cannot come from
> HIGHMEM. This imply that a straight page_address() can replace the kmap()
> of sg_page(sg) in nvmet_tcp_map_pdu_iovec(). As a side effect, we might
> also delete the field "nr_mapped" from struct "nvmet_tcp_cmd" because,
> after removing the kmap() calls, there would be no longer any need of it.
>
> In addition, there is no reason to use a kvec for the command receive
> data buffers iovec, use a bio_vec instead and let iov_iter handle the
> buffer mapping and data copy.
>
> Test with blktests on a QEMU/KVM x86_32 VM, 6GB RAM, booting a kernel with
> HIGHMEM64GB enabled.
>
> [1] "[PATCH] checkpatch: Add kmap and kmap_atomic to the deprecated
> list" https://lore.kernel.org/all/20220813220034.806698-1-ira.weiny@intel.com/
>
> Cc: Chaitanya Kulkarni <chaitanyak@nvidia.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Keith Busch <kbusch@kernel.org>
> Suggested-by: Ira Weiny <ira.weiny@intel.com>
> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> [sagi: added bio_vec plus minor naming changes]
> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
> ---
> drivers/nvme/target/tcp.c | 44 ++++++++++++---------------------------
> 1 file changed, 13 insertions(+), 31 deletions(-)
Hi Sagi,
Thanks for changing the code according to the suggestions from Christoph and
Al.
Differently from what I just wrote while thanking Al, and after Ira made me
notice that you are one of the maintainers, I decided to leave everything like
you did.
The only exceptions we'll be about sending a v2 with the "Suggested-by" tags
from Christoph and Al. In the meantime checkpatch warned that the alignment of
"nr_pages" doesn't match the open parenthesis, so I'm changing it too.
Again thanks,
Fabio
prev parent reply other threads:[~2022-08-30 21:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-29 7:54 [PATCH] nvmet-tcp: Don't map pages which can't come from HIGHMEM Sagi Grimberg
2022-08-30 21:40 ` 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=5295597.Sb9uPGUboI@opensuse \
--to=fmdefrancesco@gmail.com \
--cc=Chaitanya.Kulkarni@wdc.com \
--cc=anirudh.venkataramanan@intel.com \
--cc=hch@lst.de \
--cc=ira.weiny@intel.com \
--cc=james.smart@broadcom.com \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
--cc=viro@zeniv.linux.org.uk \
/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