Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp651278rwe; Fri, 26 Aug 2022 11:34:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ekwYeS78+VikaEbSQfhMQgtpUoLlT1bqRSwHFi/1G39Tv+dS9fSr8x/d6YgEJSKu9CMuC X-Received: by 2002:a17:90a:404f:b0:1fa:eaac:4fd1 with SMTP id k15-20020a17090a404f00b001faeaac4fd1mr5607009pjg.113.1661538868246; Fri, 26 Aug 2022 11:34:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661538868; cv=none; d=google.com; s=arc-20160816; b=SjN2xbdADNTkbKSm1sFuWezy0o/3gIrOdNfiKEDfpsWbCwFmYQahN00UF4SHaZvpZ2 RVGuBh+Cinr2PtQoLTzKL/SGFzTvJO3mjLbuHoM/eeA96zYb8HLDP3vLWdPyvM1yBjPW TpmT/8asmN2TjvxY2VAiU1vZUXcVBqozEIkNTuFIy6GWaXA6rq+4E/H+RG9sulIqPpRU hyq4Vp52IiTfYY03iruDOAwiL0hFRR3qJbPeSMBmIIBL4ZacveKaisMVQcmCgTHBIfNU 6FmtedwQ8hwW1srHJyrT7JPxANBHnzWdjNoQCPUhMxem+EP+pDw3xfQGdG5PO5KSSoha XCqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XnP47D2a+NfTs/kKZwaTdIdxwiCYCTPoKf3Nst+QNqM=; b=auahp9MAXnWaNKf5JumskieOqCt9yHl1NP/m+sng8+9ZYD+9S7dT8wVyMhqjAk7tBn W0wP9arda3LuTgynTA5beWZlf/iKfOJ6PUA4OYYXvGqbT1YIc2V+477hA9hyD1o23qfu u2o04gZKBOsA5EDXlaAsHvcBQWyZK2rezClnHkcramdUWqbyyZCxVg4ihXdZcHfDl+TC RErV1MaYu7/+Smd2QKrTDT2mhKuX5dBFE3HQGs4CnPm7N8EeO3YxvBl4UX4yVQab2ks7 SuPbWCSeQC9HANrO/Dh6bYrXaTAiymVd2B5fROrsewoPNp4TQv7BvyJ4CGw4jmjR67TQ MEdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MJccE0t6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b8-20020a170902b60800b00172ec01c8d9si1945868pls.156.2022.08.26.11.34.12; Fri, 26 Aug 2022 11:34:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=MJccE0t6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344826AbiHZSRJ (ORCPT + 99 others); Fri, 26 Aug 2022 14:17:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245175AbiHZSRG (ORCPT ); Fri, 26 Aug 2022 14:17:06 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CFE6CCE3D for ; Fri, 26 Aug 2022 11:17:05 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id b16so3077853edd.4 for ; Fri, 26 Aug 2022 11:17:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=XnP47D2a+NfTs/kKZwaTdIdxwiCYCTPoKf3Nst+QNqM=; b=MJccE0t6UXng4JnP+czJWRP/siy5ayy03+Ez+0NNbsvQizm+awEbThpgN9ow4KbUoK ZFvbNdkR8HtTVUXE0cULcfDZdg/S2X3m1kwyP+vtJcDjfgH8VNiL6ePm2CFX8D4xiAn7 u3i3a2MqU4YJ71SZsSRiBuckf80cBMQXe/6r989HTxkdLpKoLQDAKPCEft5CHiSMfom6 CCvtry2Tm2AwyewqahV+Q4DRjgeeRxqWl5B04qUO/L4UIgbCcKT5OBwIr8r8t3I/pidj copqlXuXFCRP/k5wSA79EcFTx7fhvjY/UrSOYIJDwKkMPfs7PYmFNkcWZJFbQH1XGRj/ iR8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=XnP47D2a+NfTs/kKZwaTdIdxwiCYCTPoKf3Nst+QNqM=; b=Fe/8eKnHyfiJRH7gTO4HDTkbWgPdaW8oV5CcXzxWO86aueolcTb6NC4ChJjsYbvtlg bKKuWBSc+aUKAljyVapxoQEOFJamrOLiTxY0BjwnvFVtO//QQ2/VpAALuwWlPhH/K2BY +HL+mWWeNL7kIQPiGPcQNm3iEXkK5Vq6RsH4iXs7+jXzACenCE8JqZCrDKwjLtVTZ28n NPiFInJ+thKQQbbM0c11u0ta5zKaH2wCpdUZmdOwmeYOTF4XtcTtwujCs71NsI8Dlmsx VN7sTePMIYs9MX1NrVNMIUo9eYNqXyqgcqjWo7NodcNutviHjCkBRpErJfNB/Es61Si1 tQjg== X-Gm-Message-State: ACgBeo2b2qy2YGZ7mqd/TJ1OIA1eK6cxRoNq99MarrV7qLb9C1nARcgD g6UA48CUKSOFh5bGAoPbHqM= X-Received: by 2002:a05:6402:448b:b0:43b:5ec6:8863 with SMTP id er11-20020a056402448b00b0043b5ec68863mr7522282edb.377.1661537823830; Fri, 26 Aug 2022 11:17:03 -0700 (PDT) Received: from opensuse.localnet (host-87-17-106-94.retail.telecomitalia.it. [87.17.106.94]) by smtp.gmail.com with ESMTPSA id y3-20020aa7c243000000b004479ef996b8sm1640963edo.11.2022.08.26.11.17.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Aug 2022 11:17:02 -0700 (PDT) From: "Fabio M. De Francesco" To: Al Viro Cc: Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , James Smart , Ira Weiny , "Venkataramanan, Anirudh" , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Chaitanya Kulkarni , Keith Busch 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 Message-ID: <2887364.VdNmn5OnKV@opensuse> In-Reply-To: References: <20220822142438.5954-1-fmdefrancesco@gmail.com> <20220822142438.5954-2-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On mercoled=C3=AC 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(). >=20 > 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 suggest= ed=20 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= =20 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= =20 switch from one to the other (after learning from other code), however I wo= n't=20 be able to explain in the commit message why users should better use BVEC i= n=20 this case. My task is to remove as many kmap() call sites I can from the entire kernel= ,=20 and this is all I did in nvmet-tcp. After doing many tens of call sites=20 removals or conversions to kmap_local_page(), I learned to not go deep into= =20 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 separ= ate patch), I did some research which seems to confirm that iov_iter_kvec() may= be=20 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, =46abio [1] https://lore.kernel.org/all/8107517.T7Z3S40VBb@opensuse/