From patchwork Thu Mar 16 15:25:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13177801 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A504EC6FD1F for ; Thu, 16 Mar 2023 15:26:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1503B900004; Thu, 16 Mar 2023 11:26:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D9EB900002; Thu, 16 Mar 2023 11:26:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E955F900004; Thu, 16 Mar 2023 11:26:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id DA53B900002 for ; Thu, 16 Mar 2023 11:26:34 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id B2D8E406B6 for ; Thu, 16 Mar 2023 15:26:34 +0000 (UTC) X-FDA: 80575138308.13.55BF5FE Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf12.hostedemail.com (Postfix) with ESMTP id D60564001B for ; Thu, 16 Mar 2023 15:26:32 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=P9OodY0O; spf=pass (imf12.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678980392; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Jp818uqIiXwVZdp69UNUHXRADr94Nvu0NDkz6WG9MO0=; b=sxwdFrRja9itqAD4B9MKEXmSTR9fITwut0PGSAcmQcElFXSLA3IW7AylrMa1ugt799GRh+ +wJPIfUkVRp0JTzMuV78KyJ4FklumxPThM2I+4jUH5VIC4AJukVzElFOnT+xaiAw/D1/bW rX2buUjg/PPqqa5BAwFnyxaTFmhehM0= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=P9OodY0O; spf=pass (imf12.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678980392; a=rsa-sha256; cv=none; b=FbDE6uXinWzsXbhA/R4FwtnrtRgAUhLrLE5iSp7BrjqsOv72OT54L0uUFRLfCqQqueZ8Hs rngPwy64zPp7HvCcMnPKjL7Yh+V/Ks2MtGNBr9BVny/ktdzLZpQEKb14PDdXywQ8ZtYamw pDlO5ULOObPLMKCAA8xaz6pdezUj9rU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678980392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jp818uqIiXwVZdp69UNUHXRADr94Nvu0NDkz6WG9MO0=; b=P9OodY0ODYfBX4tnHl4JLkzp0eN1ZSyiziX/3i9/A04Cx1cALbelYHWDeLe12qi9YBsVRb OCrc+AX30SKxgpXfjRUGDbFrlU6iHgFHOGOwwPckpwwnCcUGm9xs5HzsnxDBDlj9qBQ/CB GN+TpQOeB5RExBBcoxWLIeCtWaw8EZI= 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-208-5oyLTBYpPFiR48_BvOmftQ-1; Thu, 16 Mar 2023 11:26:26 -0400 X-MC-Unique: 5oyLTBYpPFiR48_BvOmftQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E00D528237D2; Thu, 16 Mar 2023 15:26:25 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2204B40C6E67; Thu, 16 Mar 2023 15:26:24 +0000 (UTC) From: David Howells To: Matthew Wilcox , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: David Howells , Al Viro , Christoph Hellwig , Jens Axboe , Jeff Layton , Christian Brauner , Linus Torvalds , netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 01/28] net: Declare MSG_SPLICE_PAGES internal sendmsg() flag Date: Thu, 16 Mar 2023 15:25:51 +0000 Message-Id: <20230316152618.711970-2-dhowells@redhat.com> In-Reply-To: <20230316152618.711970-1-dhowells@redhat.com> References: <20230316152618.711970-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: ehimqyi3311jz1r6yt1rusoxdpscwzzt X-Rspamd-Queue-Id: D60564001B X-HE-Tag: 1678980392-950171 X-HE-Meta: U2FsdGVkX189W9PcfXPjwAmNxQruBtxxtBvH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+ngrKb9snlPgeCH83chA/rIDryKwqLmKAltul47kLt/kYuXr5GHUBbscFJ1ocm+U51YPe3WVrd83CGlcUL122geLSLQcTSt3uV5sNoVhyh8StHVyO+Iq65d1FXIBJqjgqIKtXtf9SjPfYFsfeXdaOnkS23JCgJStkoNhWlEhZtoXJrCJwJSbWYbT6+g0Njq4ZjXJj53Kn9/X/OwOW9FJbDU9H8hHRO20dKIufPmUzrbbM+/V8RCTCTov6ih4QxIcZsSbgWM7qqlnpGUnrWa3EbFnHwlbMU9K7M23Gw5e++m++TdwdWOD+6PnZnUZskg3KO5t19H X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Declare MSG_SPLICE_PAGES, an internal sendmsg() flag, that hints to a network protocol that it should splice pages from the source iterator rather than copying the data if it can. This is intended as a replacement for the ->sendpage() op, allowing a way to splice in several multipage folios in one go. Signed-off-by: David Howells cc: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: Jens Axboe cc: Matthew Wilcox cc: netdev@vger.kernel.org --- include/linux/socket.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/socket.h b/include/linux/socket.h index 13c3a237b9c9..a67d02da3c54 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h @@ -327,6 +327,7 @@ struct ucred { */ #define MSG_ZEROCOPY 0x4000000 /* Use user data in kernel path */ +#define MSG_SPLICE_PAGES 0x8000000 /* Splice the pages from the iterator in sendmsg() */ #define MSG_FASTOPEN 0x20000000 /* Send data in TCP SYN */ #define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exec for file descriptor received through