From patchwork Wed Nov 6 12:35:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13864785 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 2D071D44D58 for ; Wed, 6 Nov 2024 12:38:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B29036B0096; Wed, 6 Nov 2024 07:38:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AD7686B009F; Wed, 6 Nov 2024 07:38:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9515B6B00C7; Wed, 6 Nov 2024 07:38:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 72DF46B0096 for ; Wed, 6 Nov 2024 07:38:29 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 398BD141A0B for ; Wed, 6 Nov 2024 12:38:27 +0000 (UTC) X-FDA: 82755622404.30.28C1C7B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 7E7EA140006 for ; Wed, 6 Nov 2024 12:38:01 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=h5tqsiR3; spf=pass (imf09.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=1730896568; 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=ANDOxBXXemQtJZpSVastzB3FRnIjOshn2wSjPdvx7KRUWS0ePDmnS3HKfqUd7WmUgAuiqW I62rpd37Ijiuix/9tK9O6ElKnIct0y0Xk7pHZaFybzkpGqAlBnSbt97Xw6mkvWQMRtSne4 Z5NANiGiohr8lGWdkpuU5tD5MIydjqs= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730896568; a=rsa-sha256; cv=none; b=jpVOTCQ2ReCBUgj9r0khRov2Ao2tja6BAyWEzh8nnva+Fc5/zVQZ3qjz//OC+Njcbpo9fb ITHdQucuz+6eHFh0+RTKZMwfl15B/hOZY9Is3oSeNYvpDnvaNJJ/76hPfcmlj8xdAcQ86+ fFmjLmjWMhKNxyqr2ADO3G8M1xySC9w= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=h5tqsiR3; spf=pass (imf09.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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730896704; 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=h5tqsiR3rAwWsmQadl/hIcbtU8a/VpYRIwJ6Ws8/N2BF7u32eufGwGJnycR4eykESSNtdF XOnWyC/4TC2TM6dcHvaeuBCXj/jnGNVFuIleakpPyBtWBEfO/F2viYGeOrYUydQVINGdGC 6ed8XqWXmz1trf77LFhl8dAYM01HLaQ= 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-303-PfD41vzZNW--l4zT_hgaRw-1; Wed, 06 Nov 2024 07:38:21 -0500 X-MC-Unique: PfD41vzZNW--l4zT_hgaRw-1 X-Mimecast-MFC-AGG-ID: PfD41vzZNW--l4zT_hgaRw Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 0F54E1955EA9; Wed, 6 Nov 2024 12:38:19 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.42.28.231]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6580119560AA; Wed, 6 Nov 2024 12:38:13 +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 v3 17/33] cachefiles: Add some subrequest tracepoints Date: Wed, 6 Nov 2024 12:35:41 +0000 Message-ID: <20241106123559.724888-18-dhowells@redhat.com> In-Reply-To: <20241106123559.724888-1-dhowells@redhat.com> References: <20241106123559.724888-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 7E7EA140006 X-Stat-Signature: bbx7jcqgmn1kh1skmi1ez3b8goboqd1u X-HE-Tag: 1730896681-320043 X-HE-Meta: U2FsdGVkX18Pcjw8/nKh4A+A39+LQ8p/xKp2dcP592zqqp7twWkip932oPyoh/7XNfBsQCSthOdF7faAVrK3BnJrtl0yfGNW89Kk70JPC9XMYh99ffSIfwHc2ISqGZqGpm+1XTJeFD6uR6r1g2CXihSIjRupKaZ+b3tT4rEEYeDt1aOadA3IaqlvQ/5euwtu2C7CDf4ujhvlfEiUSRMv7WuNXNXY7+BSYty7iuCoPn86/B7qqO92jGkOAlimxiUY3TBcRLHN8gtEBsXQ+MjWNJH7q49jZVujxany9yav1cNpgeAgz3rSq5YonTJRsxsHLugfptiD9pEEz9iGZUExzH5SJzfYn5s/N/6pSzAfuK6k9pdjQOu6DhtFQMSxBpo+OW7t5k57Jy+yTq9OiJXV0QlrFvkcCl/k44WcgLLkhw8g5vT+l39QUeI3OMxrnNQEooIh/+86ogFU10ZnX7TMfdOxo1Te/DqF4ojciuwvA+j8Eqq30g2ZycbolAnLqGTSnXrzPv+HzOkFtIfHjTOoGqWK57Vr/NdZ5HCbxEUZHU8cCxKGnErZ4Ao/NMXdENAQ/HZ21IOe2yMQlwZupdhyv4KqkajguON6AZJCoFZTW7BXrXvDgsT/Cs2it8bpJqlLyYJEIU+LoHmQU8ATT2rmZAaqH2WdhHMn315/rpRBRtWte8uWSXyMZFOOJaLSHDEKTSgSDvWbCLXg5GDZXDFLU61E6/VHrQKUSmo00N+9YpW9CfiPOEeP5eqVJkVw1rSQBzHYGmAUQ5alQ8OhBvAnSgiSxPEutseTkgUSbOPrQD+6taWk+y6d+8SMOwLcTh2eDmQ8H/NE9i41TGdkmqNYKn7MN7bbai+sIwmiY9k1CQM3kY2DPwTVif2nzpLf5E5G2OU3Gm2vNSelunsGwfpBMe+Cw95HVLRoD6zXWcV/SIBiTVWNlv5hIQLGmr9yybrDlymQ3MzKvqTi9vjS2m7 KxpCAgAY yez3CX0qZqa2fWkdy9nn2HNJW29Qoi8Jekj1S93sMeFOGrJQUlVmnG9KarvCBCb5QtQZa34VfOPMJMha3al1HRPtcr8NzHZR+hPtljbcmu6bOC4TeHHfCVhAVsSDo4L65KJpPJuHPLI+jJBAy+NCNaS+oh8oi60FC3u5MG7x/cj5N35QpN8o+CaDkK14uNEPeXXTbkzdtMEyCyZNXzJBVFjD8TjeAqS9oTJ4cvmUoxe9pddiMNby2wBcBtiJJUiUUQwRFaElt9Iqgs3OzJHdVm7OeyeI4GJJFhVvb87LksX/I2027T5P2OCq6nVw9G0wZD24MlElulKuYPIsHguxv4TIz1tpd3HnYqnWOgE7gkLU2ZRuQ5MLadYSMSL72gLLT1AyCA5Igh0p4Z8xYFzjPbFn2QLEDeswOzXYL6CSPrcSoapV6yPsOv7aPcA== 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") \