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]
Date:   Fri, 26 Aug 2022 20:16:59 +0200
From:   "Fabio M. De Francesco" <fmdefrancesco@...il.com>
To:     Al Viro <viro@...iv.linux.org.uk>
Cc:     Christoph Hellwig <hch@....de>, Sagi Grimberg <sagi@...mberg.me>,
        Chaitanya Kulkarni <kch@...dia.com>,
        James Smart <james.smart@...adcom.com>,
        Ira Weiny <ira.weiny@...el.com>,
        "Venkataramanan, Anirudh" <anirudh.venkataramanan@...el.com>,
        linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Chaitanya Kulkarni <chaitanyak@...dia.com>,
        Keith Busch <kbusch@...nel.org>
Subject: Re: [PATCH v3 1/1] nvmet-tcp: Don't kmap() pages which can't come from HIGHMEM

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/



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ