From patchwork Fri May 19 07:40:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13247777 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 7D5E7C77B7A for ; Fri, 19 May 2023 07:42:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 14A9790001E; Fri, 19 May 2023 03:42:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D562900003; Fri, 19 May 2023 03:42:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB6E190001E; Fri, 19 May 2023 03:42:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id D935A900003 for ; Fri, 19 May 2023 03:42:27 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id BB597ADE61 for ; Fri, 19 May 2023 07:42:27 +0000 (UTC) X-FDA: 80806211934.14.96F89B2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf19.hostedemail.com (Postfix) with ESMTP id E5F881A0014 for ; Fri, 19 May 2023 07:42:25 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=bYPeSm6y; spf=pass (imf19.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.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=1684482146; a=rsa-sha256; cv=none; b=GRBFxUSJFR2kDe/c/wMoq4xlE/E1pNnHdmuzY8SCPhF3esp/MeR9Tqo3CQMeZWvQ8YuQTG ZMX/U36F59Cb9rHFHd5c7wrV+0TPPQVWXHiCGBfNSlbWYfEFQPsx1lDTQlk+38SR5jsksc plN0V4Vw1NBQYbswjJLNIxZ4fmeCadU= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=bYPeSm6y; spf=pass (imf19.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.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=1684482145; 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=mbYjI1mFg3thAEdOWfyRBtPSF9SFp7VqzA4DBX9XOaM=; b=lnrVbbh/c2+oYWc8/7VqVNfMcNM7j+mb5N6UueR1Kt6xpV52Jt0zxR6yyXugGWmoyTP0d5 PAR3WOCEwlxjZHMNjyF7ybIQfzE3ktlFmNGkJfZ3BQlmEq666JdBHgeYx9v4v0A1BFqdOb WpK+XYpMohWEmi0UxAZGl/meO75+PbA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684482145; 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=mbYjI1mFg3thAEdOWfyRBtPSF9SFp7VqzA4DBX9XOaM=; b=bYPeSm6yGvTCA6pQmfGKyHlMB3X3SVeeOm5r6FLHdfZ4/IkRRv1oM/NmJ5CJjVKp7KyBc7 6pLOi9JOSR+sMVfmvSEL2CCfw01QNB7+H/Kj3gTAqNjCrO7uXsldEXwv5CjJnM9YkDhBO2 SpDWXf3B2QJ/v5BQ+Uqgyo3wcKSj28E= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-633-8jk5gKwVNnagZwC444Xzmg-1; Fri, 19 May 2023 03:42:19 -0400 X-MC-Unique: 8jk5gKwVNnagZwC444Xzmg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DF47D800C81; Fri, 19 May 2023 07:42:18 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 759107AE4; Fri, 19 May 2023 07:42:16 +0000 (UTC) From: David Howells To: Jens Axboe , Al Viro , Christoph Hellwig Cc: David Howells , Matthew Wilcox , Jan Kara , Jeff Layton , David Hildenbrand , Jason Gunthorpe , Logan Gunthorpe , Hillf Danton , Christian Brauner , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Christoph Hellwig , Steven Rostedt , Masami Hiramatsu , linux-trace-kernel@vger.kernel.org Subject: [PATCH v20 23/32] splice: Convert trace/seq to use direct_splice_read() Date: Fri, 19 May 2023 08:40:38 +0100 Message-Id: <20230519074047.1739879-24-dhowells@redhat.com> In-Reply-To: <20230519074047.1739879-1-dhowells@redhat.com> References: <20230519074047.1739879-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: E5F881A0014 X-Stat-Signature: wjbjeynyinidg7nc7m6wtaydezwwfsqd X-Rspam-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6bNx4pX/mRkdcHKCpnkoVlWgghxtSuBgurCkumB6WHfO07IIni+dSMIcRnEPr3G8KLdywFA+G2yNgWPpN4WwrSXzMxo+SSEiaNuyxUSGBa+ogMRjeRQTjDm5dKQ9X4YpTaK4SXPIz6fqOAaUv2iPtABMy8Sog4LW2NCKBungXSOgzxnyR1PiRD2Gn4z4QZJaFkNjnhnXALg6zjLxJYF5Bu08/fvL2oK156wWlBQQHqr09SbqqrJgLgB4LWz7CU33GMTzIV3vHNhq7LFZUI6m+MgLA0s7iBlbUtriVWzrp0l5azBcWEUZbL1IHEwoTBtbTMqz82Tr/6z0j39a5nQW2G9Kgyct8JtnNJXIOahW8tJty1WWIqdny2PuSJTdKgE= 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: For the splice from the trace seq buffer, just use direct_splice_read(). In the future, something better can probably be done by gifting pages from seq->buf into the pipe, but that would require changing seq->buf into a vmap over an array of pages. Signed-off-by: David Howells cc: Christoph Hellwig cc: Al Viro cc: Jens Axboe cc: Steven Rostedt cc: Masami Hiramatsu cc: linux-kernel@vger.kernel.org cc: linux-trace-kernel@vger.kernel.org cc: linux-fsdevel@vger.kernel.org cc: linux-block@vger.kernel.org cc: linux-mm@kvack.org Acked-by: Steven Rostedt (Google) --- kernel/trace/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index ebc59781456a..b664020efcb7 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -5171,7 +5171,7 @@ static const struct file_operations tracing_fops = { .open = tracing_open, .read = seq_read, .read_iter = seq_read_iter, - .splice_read = generic_file_splice_read, + .splice_read = direct_splice_read, .write = tracing_write_stub, .llseek = tracing_lseek, .release = tracing_release,