Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1971810rwl; Thu, 6 Apr 2023 04:11:30 -0700 (PDT) X-Google-Smtp-Source: AKy350Y2Gfms0NzyR+shYRifRS6su1KRQirTW3X16aYQHQ6pO4Mz73BTikFs/sfN2WcGyCkk0/ry X-Received: by 2002:a05:6a20:b227:b0:d8:fd3b:f1ba with SMTP id eh39-20020a056a20b22700b000d8fd3bf1bamr2532502pzb.3.1680779490225; Thu, 06 Apr 2023 04:11:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680779490; cv=none; d=google.com; s=arc-20160816; b=s9MW3dR9mYC1yFLx7W28xTETF105iwSITsWMUnCE9B9CTCVIVYZsN/gp+VdjMAfhoZ quE8GK+M53Jse1o7YiUX3yZHkmYRsRbZ7zzuNbXk3SWNeOwtzJQhx4L3pDnNb2Mvytme 67+ZiXIxLIdlZTHYTDvBZ3Csm6uQu8PL7nnzg2jjH6MHkE7W28XuDLdpiJu2u/oMbdgH NMQ4JGGCi0H3aAkUgLH+1cgi5JuJU93HIZDIUlCiLqmgah43D/Xcqnxb3NgCq9F7qxh+ OJgkyYuYi8gP0s9wsr7WcUFpuAsGTeinOe/A9vwjPcxtdbpbT7mvBa5mAGGmSCS0L7Mx bcbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=zMeQxZQg6MXfV4MGHzz3ouxaZBZa4sXe5adkrdIvgDA=; b=xZTKp+x3KldCqGdSsUu4HkTURaNqaMdL6f09Jrh+dRGuNqBGjh7MaGlNzByEZAJ6F0 aUvNeFJalGuendxYBhqKdyKnU7jsMGKmzgDgQv7Q6F0boQeP6f6Tj52JYMHJ50LjO9QF oo51V9BkZUDjq9DP1EIxQpNdMo6tAsxbA4+fWSBKLZw/ARTg/V4aQaHXVS8fEVBkdqNt 2/3sSdMUYu58OVlHmKwe4OVSFz72bLDAU10WN1vcphBT0tQOKCJ5kw8ji5r8Wq9iR0xv d8Rw3y4Fi7asPiUN+riq0eZ6M9Y2Et04JecNhwYWMealy8VJxSn0kq21i1KPtp+bTtij g6Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NBhQJ1f2; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b34-20020a631b62000000b0051367d909efsi1017648pgm.106.2023.04.06.04.11.17; Thu, 06 Apr 2023 04:11:30 -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=@redhat.com header.s=mimecast20190719 header.b=NBhQJ1f2; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237373AbjDFK5d (ORCPT + 99 others); Thu, 6 Apr 2023 06:57:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234983AbjDFK5b (ORCPT ); Thu, 6 Apr 2023 06:57:31 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F9816A52 for ; Thu, 6 Apr 2023 03:56:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680778603; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zMeQxZQg6MXfV4MGHzz3ouxaZBZa4sXe5adkrdIvgDA=; b=NBhQJ1f2J8myYCDTL1tMtrUhv4sI/yoDyYEuOG+iuG5eOKTQ6rVf1U5xcCcjf7VtDatlLa oy3hZiJNLP+iB9ThgejFem6MZ/9+u07vYL1yFnZYTax4GLWYk0NqTF4avo0ZoIrPrBfsQG rMhcO1lEXrITAYNRQ6/gH9SyQ/f1Ums= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-616-dI7Qid53N0-2fcggxMEYxg-1; Thu, 06 Apr 2023 06:56:38 -0400 X-MC-Unique: dI7Qid53N0-2fcggxMEYxg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 01EB9384708E; Thu, 6 Apr 2023 10:56:38 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B936492C14; Thu, 6 Apr 2023 10:56:35 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <20230406094245.3633290-1-dhowells@redhat.com> To: Eric Dumazet Cc: dhowells@redhat.com, netdev@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Paolo Abeni , Willem de Bruijn , Matthew Wilcox , Al Viro , Christoph Hellwig , Jens Axboe , Jeff Layton , Christian Brauner , Chuck Lever III , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH net-next v5 00/19] splice, net: Replace sendpage with sendmsg(MSG_SPLICE_PAGES), part 1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3636417.1680778595.1@warthog.procyon.org.uk> Date: Thu, 06 Apr 2023 11:56:35 +0100 Message-ID: <3636418.1680778595@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 Eric Dumazet wrote: > > Here's the first tranche of patches towards providing a MSG_SPLICE_PAGES > > internal sendmsg flag that is intended to replace the ->sendpage() op with > > calls to sendmsg(). MSG_SPLICE is a hint that tells the protocol that it > > should splice the pages supplied if it can and copy them if not. > > > > I find this patch series quite big/risky for 6.4 If you want me to hold this till after the merge window, that's fine. > Can you spell out why we need "unspliceable pages support" ? > This seems to add quite a lot of code in fast paths. The patches to copy unspliceable pages (patches 6, 14 and 19) only really add to the MSG_SPLICE_PAGES path - I don't know whether you count this as a fast path or not. (Or are you objecting to MSG_SPLICE_PAGES and getting rid of sendpage in general?) What I'm trying to do with this aspect is twofold: Firstly, I'm trying to make it such that the layer above can send each message in a single sendmsg() if possible. This is possible with sunrpc and siw, for example, but currently they make a whole bunch of separate calls into the transport layer - typically at least three for header, body, trailer. Secondly, I'm trying to avoid a double copy. The layer above TCP/UDP/etc (sunrpc[*], siw, etc.) needs to glue protocol bits on either end of the message body and it may have this data in the slab or on the stack - which it would then need to copy into a page fragment so that it can be zero-copied. However, if the device can handle this or we don't have sufficient frags, the network layer may decide to copy it anyway - I'm not sure how the higher layer can determine this. It just seems there are fewer places this is required if it can be done in the network protocol. Note that userspace cannot make use of this since they're not allowed to set MSG_SPLICE_PAGES. However, I have kept these bits separate and discard them if it's considered a bad idea and that MSG_SPLICE_PAGES should, say, give an error in such a case. David [*] sunrpc, at least, seems to store the header and trailer in zerocopyable pages, but has an additional bit on the front that's not.