Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2587785imw; Wed, 6 Jul 2022 08:26:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vauJgzZH+4BSQSQcojt1YGdBvAbGG+8IeIff83mhDMIXTcMq9950cp/6J0Qbk/FmbrHOlf X-Received: by 2002:a17:902:c947:b0:16b:f442:8568 with SMTP id i7-20020a170902c94700b0016bf4428568mr8657515pla.55.1657121165416; Wed, 06 Jul 2022 08:26:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657121165; cv=none; d=google.com; s=arc-20160816; b=0AKS097khxyeVAVUHGd1HLQFEFsqOPjbvZoEsI1t14AMi3VZTdo4ZDCJ75qqYivf8N 4+HUbedaPQsceQO9K58eRoVkimn7EPWVYYrHIRZk4W1tEdSCgG6oVOmpuhpmq0fX4V7W a7f7eKqnhDH7Wt0wrcBKiiOwY6BeWKaOfzdJJw9peZP6m3wF2NSBIL/YJUvxcFSlsZjh T7nSe2+y1XRwHTU9ECZpq2sd048I29+dMSbYtX/+dN1Pi6GXroPktXq3SKIF8+K58XRx I6048ZFXLc0Loefvj79fMkH/AlAC1YTO8UoL1D6JQcdGcPVLnv4SfEahzZfi5hMyMg6a u5Cw== 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:dkim-signature; bh=0t4+0NuMhuKyhwYE96uObn+Fn7wgjaM3o2VchjRzaXs=; b=KKrmZIes3WuHsGg/r8Sc7Do7ndHVEDN35hunnfNIrnb+lQqzlCUZgv23FxRgohucuh f5MDJxe492hV2ABzcUFrIP1yrhFW5V4soZqXze3+qOsM0ySSgjFa5u8ttPW1GAXufUwe rq5eSINvSPEe9Y3NZ5PWzm+Q3WNUnLID3P7/XVKh0LV6xwehPc/lioxkLUmJPqCZfD4E gaYNmuIHgjMtlYrCxILtiDzWdR3hDVF5fDwzFeAIrasnlJdLQoOWKzeMV2GmbU0z0+Cr Ex7SZGmulIW6/ouxNVFOkvCEYqEv4DvLGaknuxjOnwP/UIcwO+DtmdOFaZrr+CLC0mk4 7ePw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gw8mON+x; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z3-20020a623303000000b005284a6a3faesi2835192pfz.342.2022.07.06.08.25.53; Wed, 06 Jul 2022 08:26:05 -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=@kernel.org header.s=k20201202 header.b=gw8mON+x; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232890AbiGFPLQ (ORCPT + 99 others); Wed, 6 Jul 2022 11:11:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232706AbiGFPLP (ORCPT ); Wed, 6 Jul 2022 11:11:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAD3865D7; Wed, 6 Jul 2022 08:11:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 55C7061F97; Wed, 6 Jul 2022 15:11:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41565C3411C; Wed, 6 Jul 2022 15:11:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657120273; bh=0t4+0NuMhuKyhwYE96uObn+Fn7wgjaM3o2VchjRzaXs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=gw8mON+xl+eQZmkqxAgwIhnso4d59umDNj6K4PGfjWW/FO0S61A6g52NhqKfboWoS JQUCnAHe5SqBTSHrQWH+CEkJ3yb07oIOsID5bF4XYGrdOZENOIAsUoFGf+QW9atfa9 Y/vG3j6mnbZqtXUkIwWeLV7LHiDRJ7LNmXhVeUSbrrbR7Vqm/90nH1OgeBkDrwcNZE Mc6L1vNr7YJ0uNRcNaTrDhQsePdrHASKZQRhXulpN6a2b+8kWJq/KhlWIUDWwMRGzz VUOQaki583qvQmgazlzxIRrtsRyWB0XPo8+U6Xkv9beaG6CB1t5blrx2GfgUTa5EFO Fz7rZOVR3YfwA== Message-ID: Date: Wed, 6 Jul 2022 09:11:11 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [RFC net-next v3 05/29] net: bvec specific path in zerocopy_sg_from_iter Content-Language: en-US To: Pavel Begunkov Cc: io-uring@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "David S . Miller" , Jakub Kicinski , Jonathan Lemon , Willem de Bruijn , Jens Axboe , kernel-team@fb.com References: <5143111391e771dc97237e2a5e6a74223ef8f15f.1653992701.git.asml.silence@gmail.com> <20220628225204.GA27554@u2004-local> <2840ec03-1d2b-f9c8-f215-61430f758925@gmail.com> <6943e4a8-0b19-c35a-d6e5-9329dc03cc3e@gmail.com> From: David Ahern In-Reply-To: <6943e4a8-0b19-c35a-d6e5-9329dc03cc3e@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,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 7/5/22 4:09 PM, Pavel Begunkov wrote: > On 7/5/22 15:03, Pavel Begunkov wrote: >> On 7/5/22 03:28, David Ahern wrote: >>> On 7/4/22 7:31 AM, Pavel Begunkov wrote: >>>> If the series is going to be picked up for 5.20, how about we delay >>>> this one for 5.21? I'll have time to think about it (maybe moving >>>> the skb managed flag setup inside?), and will anyway need to send >>>> some omitted patches then. >>>> >>> >>> I think it reads better for io_uring and future extensions for io_uring >>> to contain the optimized bvec iter handler and setting the managed flag. >>> Too many disjointed assumptions the way the code is now. By pulling that >>> into io_uring, core code does not make assumptions that "managed" means >>> bvec and no page references - rather that is embedded in the code that >>> cares. >> >> Core code would still need to know when to remove the skb's managed >> flag, e.g. in case of mixing. Can be worked out but with assumptions, >> which doesn't look better that it currently is. I'll post a 5.20 >> rebased version and will iron it out on the way then. Sure. My comment was that MANAGED means something else (not core code) manages the page references on the skb frags. That flag does not need to be linked to a customized bvec. > @@ -66,16 +68,13 @@ struct msghdr { >      }; >      bool        msg_control_is_user : 1; >      bool        msg_get_inq : 1;/* return INQ after receive */ > -    /* > -     * The data pages are pinned and won't be released before ->msg_ubuf > -     * is released. ->msg_iter should point to a bvec and ->msg_ubuf has > -     * to be non-NULL. > -     */ > -    bool        msg_managed_data : 1; >      unsigned int    msg_flags;    /* flags on received message */ >      __kernel_size_t    msg_controllen;    /* ancillary data buffer > length */ >      struct kiocb    *msg_iocb;    /* ptr to iocb for async requests */ >      struct ubuf_info *msg_ubuf; > + > +    int (*sg_from_iter)(struct sock *sk, struct sk_buff *skb, > +                struct iov_iter *from, size_t length); >  }; >   Putting in msghdr works too. I chose ubuf_info because it is directly related to the ZC path, but that struct is getting tight on space.