Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3331521rwd; Mon, 22 May 2023 12:03:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6nLP8e5SpgZ6lQymprfx4A1E6JniIvdljEImLZ9W0ZIpNS9ZX6MO465bLXPqyFoHWEXZoS X-Received: by 2002:a17:90a:46c8:b0:24e:3b3e:f348 with SMTP id x8-20020a17090a46c800b0024e3b3ef348mr12251959pjg.2.1684782228109; Mon, 22 May 2023 12:03:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684782228; cv=none; d=google.com; s=arc-20160816; b=ULFJDvG1fpmUKO4yrouvkgffnAhe1bhbWyqwQBZC2dM4NSnkviAeRaqju2R4IA/8Bk guEk2Y3OdNn5d12Fw3sIx5mbGopSqZT+UxBLYIG15+3A2yPeTRFEbU9bOddgOh1xAO+D 8isv7GLyM/DtjyJcK+J6eUE+ujOW8AA0b91mk7fzEBGL0pLiJmAGYqm2Me0q0m2qB81Q kYp8zwoUEF0HlwdNCsVQKoJ8cRLfrnKGvTY89nGxusmTWCEO+dnpn6P118j/5I5DaygW b00cNHDDMGZEL+x9FP0Lx/nKgmClcn9tp4g4127/HpEoC7BF2J6AGxWyXPazWcax4G5N 1R0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=EOrl79QwNKSl/DVpX6wO0zeUM24lUX1mNNWSZGEm3AY=; b=ecMz5jivjzCieT4HRP+bAt2VKyIXjis+jnKDE1s4Rg2tCqIlTmjdKBeOYtpAsMRKCK 8uK4embhp5PY/Ev3lnbsyNDY+qGLGAiQ67mJm/XYyUEsQ28D24UxEu988jS4XVOQDPgZ gEAPFttZCntItIVl4Z+XtMeAMxVZN1zhpUw7L3Y/w+7TDMFdGcjo+2wrKIr675KJK5WZ PhFr1fQsezSOHA2OszjLVb8gzyKkK4h5QkixzeuJ+K6tkc9/kcKe0d7Ap7qiqdn1KmLb NoKrWZNM3d72uXJGgfjQW4xHGPJNsaYpCyzv1jfVqZd6v9EsbbOd4pKioE7kJZDid4B4 47+g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a21-20020a637055000000b005181ce23024si5155584pgn.896.2023.05.22.12.03.35; Mon, 22 May 2023 12:03:48 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230237AbjEVSiY convert rfc822-to-8bit (ORCPT + 99 others); Mon, 22 May 2023 14:38:24 -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 X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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 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