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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F36DC77B73 for ; Mon, 22 May 2023 18:38:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229874AbjEVSiX convert rfc822-to-8bit (ORCPT ); Mon, 22 May 2023 14:38:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230093AbjEVSiW (ORCPT ); Mon, 22 May 2023 14:38:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 754ACB6; Mon, 22 May 2023 11:38:21 -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 12CAE6226A; 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: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-trace-kernel@vger.kernel.org On Mon, 22 May 2023 10:42:12 -0700 Linus Torvalds wrote: > On Mon, May 22, 2023 at 7:50 AM David Howells wrote: > > > > We could implement seq_splice_read(). What we would need to do is to change > > how the seq buffer is allocated: bulk allocate a bunch of arbitrary pages > > 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 pipe. > > Please don't use vmap as a way to do zero-copy. > > The virtual mapping games are more expensive than a small copy from > some random seq file. > > 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