public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Chaitanya Kulkarni <kch@nvidia.com>,
	James Smart <james.smart@broadcom.com>,
	Ira Weiny <ira.weiny@intel.com>,
	"Venkataramanan, Anirudh" <anirudh.venkataramanan@intel.com>,
	linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
	Chaitanya Kulkarni <chaitanyak@nvidia.com>,
	Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH v3 1/1] nvmet-tcp: Don't kmap() pages which can't come from HIGHMEM
Date: Fri, 26 Aug 2022 20:16:59 +0200	[thread overview]
Message-ID: <2887364.VdNmn5OnKV@opensuse> (raw)
In-Reply-To: <YwVjpTW6vWvdVQTK@ZenIV>

On mercoledì 24 agosto 2022 01:32:53 CEST Al Viro wrote:
> On Mon, Aug 22, 2022 at 04:24:38PM +0200, Fabio M. De Francesco wrote:
> > Therefore, replace the kmap() of sg_page(sg) with a page_address() and
> > delete the "nr_mapped" field from "nvmet_tcp_cmd" and instead pass a
> > local variable to iov_iter_kvec() from the call site in
> > nvmet_tcp_map_pdu_iovec().
> 
> I'd suggest looking into switching to ITER_BVEC...

Hello Al,

It's interesting that, for the second time in a few days, I've been suggested 
to switch to the use of BVEC. Christoph asked for first[1]

I responded to Christoph and, in the same email, I also asked Sagi
(the author of nvmet_tcp_map_pdu_iovec()) if he wanted to add something to 
that discussion.

As you may have already read, I'm so new to kernel development that I still
know very little about many subsystems and drivers. I am not currently
able to tell the difference between BVEC and KVEC. I could probably try to 
switch from one to the other (after learning from other code), however I won't 
be able to explain in the commit message why users should better use BVEC in 
this case.

My task is to remove as many kmap() call sites I can from the entire kernel, 
and this is all I did in nvmet-tcp. After doing many tens of call sites 
removals or conversions to kmap_local_page(), I learned to not go deep into 
those details which aren't needed to accomplish the task I've been given.

However, since you and Christoph suggested doing more (I suppose in a separate
patch), I did some research which seems to confirm that iov_iter_kvec() may be 
good for what it is supposed to do.

Since you are talking again about BVEC, soon after Christoph did the same, I'd
like to understand better which improvements do we expect from BVEC and why
and when should developers prefer this or KVEC.

Can you please provide further information or links to documentation?

Thanks for your time,

Fabio

[1]   https://lore.kernel.org/all/8107517.T7Z3S40VBb@opensuse/




  reply	other threads:[~2022-08-26 18:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-22 14:24 [PATCH v3 0/1] Don't kmap() pages which can't come from HIGHMEM Fabio M. De Francesco
2022-08-22 14:24 ` [PATCH v3 1/1] nvmet-tcp: " Fabio M. De Francesco
2022-08-23 23:32   ` Al Viro
2022-08-26 18:16     ` Fabio M. De Francesco [this message]
2022-08-26 18:35       ` Keith Busch
2022-08-26 19:35         ` Al Viro
2022-08-26 19:32       ` Al Viro
2022-08-28 14:31         ` Sagi Grimberg
2022-08-30 20:06         ` Fabio M. De Francesco
2022-08-31 23:48           ` Al Viro

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=2887364.VdNmn5OnKV@opensuse \
    --to=fmdefrancesco@gmail.com \
    --cc=anirudh.venkataramanan@intel.com \
    --cc=chaitanyak@nvidia.com \
    --cc=hch@lst.de \
    --cc=ira.weiny@intel.com \
    --cc=james.smart@broadcom.com \
    --cc=kbusch@kernel.org \
    --cc=kch@nvidia.com \
    --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