From mboxrd@z Thu Jan 1 00:00:00 1970 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 A859FC7EE23 for ; Mon, 22 May 2023 18:38:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 39B4D6B0074; Mon, 22 May 2023 14:38:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 34A806B0075; Mon, 22 May 2023 14:38:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 26163900002; Mon, 22 May 2023 14:38:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 177EC6B0074 for ; Mon, 22 May 2023 14:38:24 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id D99E3A026C for ; Mon, 22 May 2023 18:38:23 +0000 (UTC) X-FDA: 80818751286.22.547CBF6 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf27.hostedemail.com (Postfix) with ESMTP id 31F304000C for ; Mon, 22 May 2023 18:38:21 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of "SRS0=W0MB=BL=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=W0MB=BL=goodmis.org=rostedt@kernel.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684780702; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5632sLcS3gXUQOg/Bcl5hzyzoujlmk+48GhHw6CvG3M=; b=tnz5mLFTd9iuWynbXYJjk4Ga9qChEINacU4ECqUaHTbHAENKtgiRb/ybEXOWFtjLe+osZp aJXZG3WmRfyoSltsiUXRZP7kJzKle1Uf5Vehw4LpQmFnUnPrJ+/J6I8TBgBznxZknvlxOe CpGt9g3bn3Fjgva76hsZfvQJZEkdZAQ= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of "SRS0=W0MB=BL=goodmis.org=rostedt@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=W0MB=BL=goodmis.org=rostedt@kernel.org"; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684780702; a=rsa-sha256; cv=none; b=eccwMxcCPJLq0ll+fMc+IDM4HxrDvWP0s/klp+GtRlKX29yDuNe9R/cuo2dQ0eOixaLK70 0MVVUwWg40c2ZFTTJhuB/YP5ii1kUMZpTPgKBnhjDq+KuF2exH7wqXWidfHIF8PfTrY+Tj rNSSELXOkikf39aMR1wI2m3/xMWDjm0= 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 07CC760D33; Mon, 22 May 2023 18:38:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79441C433EF; Mon, 22 May 2023 18:38:18 +0000 (UTC) Date: Mon, 22 May 2023 14:38:14 -0400 From: Steven Rostedt To: Linus Torvalds Cc: David Howells , Jens Axboe , Al Viro , Christoph Hellwig , Matthew Wilcox , Jan Kara , Jeff Layton , David Hildenbrand , Jason Gunthorpe , Logan Gunthorpe , Hillf Danton , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Christoph Hellwig , Masami Hiramatsu , linux-trace-kernel@vger.kernel.org Subject: Re: [PATCH v20 23/32] splice: Convert trace/seq to use direct_splice_read() Message-ID: <20230522143814.6efbbb4d@gandalf.local.home> In-Reply-To: References: <20230519074047.1739879-1-dhowells@redhat.com> <20230519074047.1739879-24-dhowells@redhat.com> <20230522102920.0528d821@rorschach.local.home> <2812412.1684767005@warthog.procyon.org.uk> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 31F304000C X-Rspam-User: X-Stat-Signature: phbrfnxn1az5ybbwid4wftjbcjc993ea X-Rspamd-Server: rspam01 X-HE-Tag: 1684780701-345805 X-HE-Meta: U2FsdGVkX1++e+u/nvJElpaCnLlPwMokng2Fqz52lEACXDhuZ67F7JLvy+61CmAhyr1xz0f0JAt+1bUxxt0ZrEfl7CI8joIIawn+J1fwOPujdIq8GGLPyo6mVIBHtyg1UeYEnNJKAs130bKR3iqDf6+UQ0LRoN6OuWKeX5n0vBUNhCRBQZo2b2p9PQZIYSTZmoKG1JEVfTFSE2/t3RV/TJZHdK8B/zQQ0nSu6nzQ1IOz6/T8u4TpMKj+jaYtKGd9NjRdNbjB0QhhIsQzVbPuWcIRD3j8whXQJAfGHJTJog99CE2ch01dxbS5Q9FLXRTxfCvTLT8wq59mYyXYaxw7yWQNdajLaD/1TTDglR5R2Amf4IevUEkajHvqES+U7CRnqRReRrv1aAPAg3PT7fy17uYyNXGfc9VasGbrd+cndsZ8j8WsEz566Wbph/Ev1NenUJb6P33kIjW2nL6mworDZYA5h8oGP+C0AA7ZZCTHSPuNyTHAGeB79b2aeWOxS0C4SE/D/8OIRrE1d8XPOk4C6MHn/RTecbbWrfLt+BBwH3LUgk2vuXRXAJs7W8QRWjtaODT4a++GapSrosVWboLZ6ocbxUd56OO+gCMu4ZFVahZKvCUKzPteZ2CqvgoOpmqEmfNJT83SmKM5RUhKo8k5BwY8d00YUvOUnJr2mcfxhBKqu2w2nmyb75Xgb9vEBkZO/oRwk6GT5ntNapCDROtEwnZx10vXO+5T/g9RxuXsGihjClZYPtf3EWcITyzSyAHlI8uSNRlhEdbNyFG+tB9JMy8TVdGKf0l/xhZ/tcR9QogUuon33FOkE9mr/YoF0NTZ9cublv0Ywaci3WludfnDbwAJ3yY4f/WQaKy6olBOVlckgnoUOt7pEb36T5A3nc5k9Z8aHZV+lfxVuyViwoLnZWpyvicWP+c3AJIekplxcHBgpq9yIYjyUJ7G2+uJMvcoYNqQlTmUI1Po+fy58lC 9SLX7GQq p8rI+TCNxFgQlSq5TvVyhMIPuOfFj+LCRj/XiVdXMPNk9NLYcphDY3B8kS3GWKXRp9MxiGGjrtJ2RvY2gj8HEg5KDmnWaXQzOsmZKY8qIiJjld8BAJ1jNyEDauJjGh83caIb16LcLcUcO1sfWpQ3AnC1nBR26cDIlDHi3T8T1Njicu/fIfbuL2oyovcFuYScly2LmhDDVwzwYlQ9htZ/rjvsvFkwvpIwQL+FYrvRqWoGJqI5yXFB9IukXEXWaBAZ33Ss8V2KQdB2fXP0Oj7xNxanBVMzS1DPK3zO4UpuTjghzGtxFf39aikrM21pslWk22qWAX7pHIhWMA9db+yoalidu4sZ8kIA0lYpSH3tfmImzBAAyNnAvRqL+RN7PdeqVh1ppeZo29KK3LVEMlXvBgU8jEQ20qDATpxHnzQWV0K5Z+oO+L7/cBfnar54jcMGqwhT35D3TnLrFBN8R7t2wx8tF1AeTZ1uBFz62 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: On Mon, 22 May 2023 10:42:12 -0700 Linus Torvalds wrote: > On Mon, May 22, 2023 at 7:50=E2=80=AFAM David Howells wrote: > > > > We could implement seq_splice_read(). What we would need to do is to c= hange > > how the seq buffer is allocated: bulk allocate a bunch of arbitrary pag= es > > which we then vmap(). When we need to splice, we read into the buffer,= do a > > vunmap() and then splice the pages holding the data we used into the pi= pe. =20 >=20 > Please don't use vmap as a way to do zero-copy. >=20 > The virtual mapping games are more expensive than a small copy from > some random seq file. >=20 > Yes, yes, seq_file currently uses "kvmalloc()", which does fall back > to vmalloc too. But the keyword there is "falls back". Most of the > time it's just a regular boring kmalloc, and most of the time a > seq-file is tiny. I was thinking this change had to do with the splice callback for trace_pipe_raw (which is a hot path that does zero copy of the ftrace ring buffer into files). But looking at this further, I see that it's for just the "trace" file, which is a textual conversion of the tracing data (slow path, although some user space uses this and parses the text, which IMHO is wrong). In other words, I don't really care much about this code being "efficient". -- Steve