From patchwork Fri Oct 25 20:39:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13851569 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 45B4AD149F2 for ; Fri, 25 Oct 2024 20:42:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C7BB06B00AF; Fri, 25 Oct 2024 16:42:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C052D6B00B1; Fri, 25 Oct 2024 16:42:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A7E7F6B00B2; Fri, 25 Oct 2024 16:42:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 806066B00AF for ; Fri, 25 Oct 2024 16:42:17 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 78EE64100F for ; Fri, 25 Oct 2024 20:42:06 +0000 (UTC) X-FDA: 82713296106.01.D8BC6A0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf17.hostedemail.com (Postfix) with ESMTP id 06FD840011 for ; Fri, 25 Oct 2024 20:41:59 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="IKm2jG/h"; spf=pass (imf17.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=1729888857; a=rsa-sha256; cv=none; b=HJU78s/gdove+uszHxZ5XqD/vroIw4tlCUhMKTi52hTaTtXiQyzgoXispgYo1oWFkRhbn/ AkZjIbsG3ZqzzhlmQEl6YxSvFfnHC9htJ+5aJ4kq0GLQz/plncyl2lUkVi9cQ/6pi+mqL5 /I2DbiOmU+xXdN3DnpzhgiEZcrXhnfU= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="IKm2jG/h"; spf=pass (imf17.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=1729888857; 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=3kDl7vtgTz4UJLk1NBKECBmgzlrlbYChuV4j2ks8Pq0=; b=NfPmz5h+Swb++p50V2anedQkImlXfS/ymHEfzR2Vtj4SfzbncHa3cxAMwiboZjz6XUq18O c06hWNA9olI0Vz9nfv08fNXd38zL+AnyCv0oMhhxvswzHRkI/6CDQ0pl7Xup8LaBXvxmTF K9sfnQV5MWn2hKp69il8JWYk6/+LmsY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729888934; 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=3kDl7vtgTz4UJLk1NBKECBmgzlrlbYChuV4j2ks8Pq0=; b=IKm2jG/hnFbJvEZ/2ur/bAyP4BPmBpEirmbna5YBUZcpFWJWPTk8dMIbLQqSq6tkGO7Nx/ KNB2S7IlG1nw5O3K/LS4h5xKdksv03JACiy5gyJu3zu/kElTBVtr6qvJJdhlRkaBdIRS7c /5h4n6O0h3f/uop8lw3QfZMDY7YiFE4= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-645-AW9tz9hWMRK9NfiJ9t_v9A-1; Fri, 25 Oct 2024 16:42:09 -0400 X-MC-Unique: AW9tz9hWMRK9NfiJ9t_v9A-1 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C3FA119560B0; Fri, 25 Oct 2024 20:42:06 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.42.28.231]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id ED8621955F43; Fri, 25 Oct 2024 20:42:01 +0000 (UTC) From: David Howells To: Christian Brauner , Steve French , Matthew Wilcox Cc: David Howells , Jeff Layton , Gao Xiang , Dominique Martinet , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , netfs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 16/31] cachefiles: Add some subrequest tracepoints Date: Fri, 25 Oct 2024 21:39:43 +0100 Message-ID: <20241025204008.4076565-17-dhowells@redhat.com> In-Reply-To: <20241025204008.4076565-1-dhowells@redhat.com> References: <20241025204008.4076565-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Stat-Signature: 18rgty83woebos6jteacyc5j4kzgotm3 X-Rspamd-Queue-Id: 06FD840011 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1729888919-306546 X-HE-Meta: U2FsdGVkX1/e4n5ZmK9agRAdJHearrWeIlwg9gKTAW3XR5QJ+NTEMudp5xV3NRSsVbNmBvnfT1OreFNC4wmibGMbC5rkNVIsWFWjShc1JJEgXsWo5DmiCyT8o45ed6XqAo1z6nOFOmYkNSoWLhwWbFroFwLdOhWnv3h40P2kJSn3SoBQL5dp8V8SpwTkz4tOHMke09MJExgtURv9J2eYBsvn2inR5z3QR49ny0FHvIC3S28SVYEI42+g1Xai0kuA9yyTmfbcsOSBMnAERK/g0EK794hrPtqNYoxRfWqGz3qrBc8WPrZvPRdFmzWvyLFsTaRXTs/YHUvoFN25ri6vbJUyQA/wFGAlh1TDxaHZI4xr96ZWXdGc6e/Fm/Bf7dYFmyi2g9iUctg0LQ++I9zAWBbFHS7crHN/Lv0qHnEEGir783CUsiiVJeoj2qcB13sicD4qHLI1dZVhtmzaj0qzUl35SeZf3r5Z/OY9tHI2pZTaeSH+OchbOcgrduEeoIN9WeZbogkpP6aJj+Srf6ja/Gb7x/BIb18zopBRFpoY2wFNBy9lXCO+28JZF2WlwrbGgQnz3nO7Z1sJLSPHIF+tHeY6H2oAWNUA0xXzVZKuAqzIxFxIKjRg9vUT/cCfG/UX/Vv+Nu0mw/3xqTEENOSip3z4jLix7Pn5iLeH6wpZ62Ji0KtI5W6D1E0I/vFLdmWJdnEE1WAZbGy8QE/NYaMV+WU+IllmoL1/DqAE9QmPXqrxu6CevaE84sBSDGUb977DWWeLNPZSJtNtX6Rp0WIrx9S6lGYg3aWYnSm7WGqaKpHFO+oiRazytq/Q/KVLaKb3CN/kE82Mxw9LLxtH2EMliztxbBe6h0gHtKJaKH9fRvG5SkM/qEerz38yb+6BpRIfb4hXbmQvFfLZ3GnIAd36NlEVANGVxfRespVADqvsPUZrQTc6hDEKeSylL4YdRoQzMb4zjePH1wz1bj1f9Rr e1vxAsaN K2T0wRzZc0Qs09TiGI1brsKImTGj0aNzU0HCwaOZcCbtlDeAdawXwm5UrjN5WshiFvtHBG4QN1zx8s3Cxzczs3/oeQphFdqUt8MIBmga0eEdv8x58wi5gibC/d1Ip6BCF4QnVNVbkgs0ZNxSVcu1BDIBATqRRA0mXJbnwswK7iyPLXsGdNTuy2lje1Po/Ckth/YoKbPgaArOgRhyVanzp/QfY3jPIzWb1mRA4urU6gN+3bfyGHM9kqO/Y0rAdSzwVjSJ10A+iUSuMZAC9Z6FiKT4SBEBibi3HKUHE9ezMvJ9WebGSFcaP3dPyuT4zKeeCv/B8q8YSu42q1VnIZjBOIGo5g13w9P/GTAWE+OM5CmYR6z0= 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: List-Subscribe: List-Unsubscribe: Add some tracepoints into the cachefiles write paths. Signed-off-by: David Howells cc: netfs@lists.linux.dev --- fs/cachefiles/io.c | 4 ++++ include/trace/events/netfs.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/fs/cachefiles/io.c b/fs/cachefiles/io.c index 6a821a959b59..92058ae43488 100644 --- a/fs/cachefiles/io.c +++ b/fs/cachefiles/io.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "internal.h" struct cachefiles_kiocb { @@ -366,6 +367,7 @@ static int cachefiles_write(struct netfs_cache_resources *cres, if (!fscache_wait_for_operation(cres, FSCACHE_WANT_WRITE)) { if (term_func) term_func(term_func_priv, -ENOBUFS, false); + trace_netfs_sreq(term_func_priv, netfs_sreq_trace_cache_nowrite); return -ENOBUFS; } @@ -695,6 +697,7 @@ static void cachefiles_issue_write(struct netfs_io_subrequest *subreq) iov_iter_truncate(&subreq->io_iter, len); } + trace_netfs_sreq(subreq, netfs_sreq_trace_cache_prepare); cachefiles_begin_secure(cache, &saved_cred); ret = __cachefiles_prepare_write(object, cachefiles_cres_file(cres), &start, &len, len, true); @@ -704,6 +707,7 @@ static void cachefiles_issue_write(struct netfs_io_subrequest *subreq) return; } + trace_netfs_sreq(subreq, netfs_sreq_trace_cache_write); cachefiles_write(&subreq->rreq->cache_resources, subreq->start, &subreq->io_iter, netfs_write_subrequest_terminated, subreq); diff --git a/include/trace/events/netfs.h b/include/trace/events/netfs.h index a0f5b13aab86..7c3c866ae183 100644 --- a/include/trace/events/netfs.h +++ b/include/trace/events/netfs.h @@ -74,6 +74,9 @@ #define netfs_sreq_traces \ EM(netfs_sreq_trace_add_donations, "+DON ") \ EM(netfs_sreq_trace_added, "ADD ") \ + EM(netfs_sreq_trace_cache_nowrite, "CA-NW") \ + EM(netfs_sreq_trace_cache_prepare, "CA-PR") \ + EM(netfs_sreq_trace_cache_write, "CA-WR") \ EM(netfs_sreq_trace_clear, "CLEAR") \ EM(netfs_sreq_trace_discard, "DSCRD") \ EM(netfs_sreq_trace_donate_to_prev, "DON-P") \