Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6063375rwd; Mon, 19 Jun 2023 01:33:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7YsxFVkGzJ34rcZknzVqKEBlV7lq8bFaM9VFTtdOq9aEMquW0GJeZUaSuhnKPqo9yvMWSj X-Received: by 2002:a17:902:d512:b0:1b6:6c32:59a8 with SMTP id b18-20020a170902d51200b001b66c3259a8mr434418plg.36.1687163629009; Mon, 19 Jun 2023 01:33:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687163628; cv=none; d=google.com; s=arc-20160816; b=egZySUBo/a81yeZXxHtxauvadDnCRh5cwh1vCefvpY+DUkOgSEhjNaqoiPW8E5ukh0 CQURrv3wU9yHYvkyIgUhri/e6lczMwG6ZGqf3Tk90Q1JVoK0tftA/gJpqBxv5l5THcc+ wtbopYJ8wE8DB4srnTN/StxIbsnARx5Ve+Du6kqvp7g3x4MP7FUQNjXuFmMDdXG04oUI gu3CQmTpTmz8K1P7b2jYHv18P+ckmREnBYNEn+q1Sopwhu8mFfLFrTaSt5p5r/c4mEaL CmOtoffS27fldVecKEZ1/DdbCpzS9pmsjL1GDNVe9T3AW0Kpc67yNUbgtgKCktqmy9w+ NJWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=iX4CLwxuTuO4frE1ZkNfG2gJ9+rD4aADOYrpxzsHz/k=; b=ySUXkI38z5Z6vqgVSvqf+YwLq4gO3PZfknpVujY070niwyEcJxGtzuhv/uhDLPXrJ6 Yal8QwAFGFAcsf3M2hSG+h5vF/Vu1+j9cvk14/WcoSjQAtx7dOcUb/DDmHZx+ZHmFDzD kFpl4pbExyv+cEIFcjIkhD1v687IXrYlLAgnFV5RlqhS17KNgRmn5BY0X+0f6L11qH6j odZBdi89Uqtp4p0TyOaC/qoYqi1SKqJ881PT4g0ivkXnRNcj5YUTxHsX94zlkUMWERg4 9Ld/4NJYl4KiP5KcxFjefp74x65yCv53UIdVFX9br9HF1D4imNi1TIH9fZrMUuUrdnzY 7wFQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ay6-20020a1709028b8600b001a63e4ff6fbsi19869154plb.178.2023.06.19.01.33.36; Mon, 19 Jun 2023 01:33:48 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230312AbjFSIZw (ORCPT + 99 others); Mon, 19 Jun 2023 04:25:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbjFSIZm (ORCPT ); Mon, 19 Jun 2023 04:25:42 -0400 Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD1ACF2; Mon, 19 Jun 2023 01:25:39 -0700 (PDT) Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-4f845ca2d92so708317e87.1; Mon, 19 Jun 2023 01:25:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687163138; x=1689755138; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iX4CLwxuTuO4frE1ZkNfG2gJ9+rD4aADOYrpxzsHz/k=; b=EdQ9pICYHyXo74TlqjHv6RzHvb+U91P3Q5hJulSJEP12ygw8JjIUNKATCLJ9a41fGG AD3aKwfxaBZotTgarEYaB/azS0fe1EZqV5oSWENa3LJpfhxedF7hk575jInBu9EbDp2C A8DhRZTKpsIjH88m3AYypvMvsqp2kPPNXxjev4ftczENBorzfQH7V43yfqoXy3bPZt41 Li2QPjil33QUSR2mRiNm1JJUsgekQx9vqvvVzlHS+23V8pF0be/5f3uGGU6GBxnvSBpa J3F34eVZufEzxEyw1e4vxWyRzTyCdNR0T6axuX3tp58zgVxoBYd84SrASRqaPd89KaHX f4sQ== X-Gm-Message-State: AC+VfDw408D4c/ive4L2n6kbxWCZe15zwFMfJRsp+RZzsfojHoGD9xja 7vgPPyie1MMpenYuMLzNeq0= X-Received: by 2002:a05:6512:25a:b0:4f7:6a87:f16f with SMTP id b26-20020a056512025a00b004f76a87f16fmr3558941lfo.4.1687163137715; Mon, 19 Jun 2023 01:25:37 -0700 (PDT) Received: from [192.168.64.192] (bzq-219-42-90.isdn.bezeqint.net. [62.219.42.90]) by smtp.gmail.com with ESMTPSA id f13-20020a7bcd0d000000b003f7ba52eeccsm9853963wmj.7.2023.06.19.01.25.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Jun 2023 01:25:37 -0700 (PDT) Message-ID: <55e7058b-07d0-3619-3481-2d70e95875ea@grimberg.me> Date: Mon, 19 Jun 2023 11:25:34 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH net-next v2 10/17] nvme: Use sendmsg(MSG_SPLICE_PAGES) rather then sendpage Content-Language: en-US To: David Howells , Willem de Bruijn Cc: netdev@vger.kernel.org, Alexander Duyck , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Ahern , Matthew Wilcox , Jens Axboe , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Keith Busch , Jens Axboe , Christoph Hellwig , Chaitanya Kulkarni , linux-nvme@lists.infradead.org References: <648f353c55ce8_33cfbc29413@willemb.c.googlers.com.notmuch> <20230617121146.716077-1-dhowells@redhat.com> <20230617121146.716077-11-dhowells@redhat.com> <755077.1687109321@warthog.procyon.org.uk> From: Sagi Grimberg In-Reply-To: <755077.1687109321@warthog.procyon.org.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 >> struct bio_vec bvec; >> struct msghdr msg = { .msg_flags = MSG_SPLICE_PAGES | ... }; >> >> .. >> >> bvec_set_virt >> iov_iter_bvec >> sock_sendmsg >> >> is a frequent pattern. Does it make sense to define a wrapper? Same for bvec_set_page. > > I dunno. I'm trying to move towards aggregating multiple pages in a bvec > before calling sendmsg if possible rather than doing it one page at a time, > but it's easier and more obvious in some places than others. That would be great to do, but nvme needs to calculate a data digest and doing that in a separate scan of the payload is not very cache friendly... There is also the fact that the payload may be sent in portions asynchronously driven by how the controller wants to accept them, so there is some complexity there. But worth looking at for sure. The patch looks good to me, taking it to run some tests (from sendpage-3-frag branch in your kernel.org tree correct?) For now, you can add: Reviewed-by: Sagi Grimberg