From patchwork Mon Dec 16 20:41:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13910340 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 52795E7717F for ; Mon, 16 Dec 2024 20:43:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D84586B00D4; Mon, 16 Dec 2024 15:43:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D33C96B00D6; Mon, 16 Dec 2024 15:43:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BAC356B00D7; Mon, 16 Dec 2024 15:43:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 995486B00D4 for ; Mon, 16 Dec 2024 15:43:35 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 5936C81075 for ; Mon, 16 Dec 2024 20:43:35 +0000 (UTC) X-FDA: 82901997696.29.D8F61E4 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf16.hostedemail.com (Postfix) with ESMTP id 3E395180004 for ; Mon, 16 Dec 2024 20:43:03 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=OQa4S10D; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf16.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734381800; 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=+h5xevLUTgx7DT+yXa3KdTAzsT6twp0kWM1j+wkaZ80=; b=lwCMCqMA9EJibEHRrE09iLfvAV04fd252cSoOofSR+h09Lg/yRdekR8T8Lcm9JpZt7Je/o +cQXDFQTvVbYDTyu0QKfd6fhlxY1RgVhkrGbOIneAVib3m049dqw2mC08K40KakAy5tvIb p8gO9xtowNtlT0EiSEtw0XqBKgBDWAU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734381800; a=rsa-sha256; cv=none; b=xLq/iAsunDZ4AJVDzN8AJZv3pWiFW/sH1s+b2Fr6PoZ3gvvLynJ065TPa6qNouSSvPlsvQ 8eb1ozfmzQXnDJ2K93V61YDeEOYU8SoYlwDLyhDnbkVwHyyWjC6bguOtnwM3W/MSDIDebu DzBcigVJ0IVXNV5nwdcTDCUM2oH0P10= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=OQa4S10D; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf16.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734381813; 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=+h5xevLUTgx7DT+yXa3KdTAzsT6twp0kWM1j+wkaZ80=; b=OQa4S10DZXzEGPd+hMYVyooWXnUuSopQZH9MEF2+9cPiUeRb1j4mq4U6tkLb4OEE7Rewgr +RfNT+y8RFeB6oIWvWktUOEcl2ueVsGirOGEuPEOrWLWFLITUBVL38wXoeSlffQlFPtxma 2AAc/AH+xyzNiTvf6uNRzNxWcVV4N7Y= Received: from mx-prod-mc-03.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-37-8FHzIFyHP_G1A-tElrmP_g-1; Mon, 16 Dec 2024 15:43:29 -0500 X-MC-Unique: 8FHzIFyHP_G1A-tElrmP_g-1 X-Mimecast-MFC-AGG-ID: 8FHzIFyHP_G1A-tElrmP_g Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 173481956064; Mon, 16 Dec 2024 20:43:27 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.48]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 79E3719560B0; Mon, 16 Dec 2024 20:43:21 +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 v5 15/32] cachefiles: Add some subrequest tracepoints Date: Mon, 16 Dec 2024 20:41:05 +0000 Message-ID: <20241216204124.3752367-16-dhowells@redhat.com> In-Reply-To: <20241216204124.3752367-1-dhowells@redhat.com> References: <20241216204124.3752367-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Stat-Signature: cebnxyhwwsu57ch7ixhg1c68ymhhhixj X-Rspamd-Queue-Id: 3E395180004 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1734381783-818432 X-HE-Meta: U2FsdGVkX198QF08LTb0mCfNxLJ6oZPpqg8uJ1tJ4d9I63C11sC/jR77zKtB2iPKGoTGkPBIrOxFhFUiFMyin7q57HRUWlbyR+jOOomx/rlrJnDNKce+/YTCSciWmaOCpy9zw9hqNLh61V2L7y4Si2eoBIdX1K4ZIuNkhmfjG1tQuFD/XrfVgNCG+/N22rRdue2LDoka40ZZapv9HUeOJJOMJ1WGZKaHoSkAWBmG0SjPvebwgQOidGdtwmUmQIXtRA56lFPsO2PhnuMjcZOVb24H0imnuXkU+III/zY4LveAUYUFutBnQVrO3qiVww/Tlt7Bw5/TUpkoXobzwydRYx23j/CO7+ODaHw/7s0b4hJrAuyswBgO/kLMyrsBA3WdHiJ1Fn+YGyMnKEYmKkY9Meij5d8igwBTFLqChSkoY40vVUUKkkHokKBRaAuSZ7yjEpg2V436GJn1XbunhAdfTMHobdZ9+wEfxMVDAoiNq5WKANrx3daFvFwguoW/aLwVJY4C2wHHoFPqj5yf7hHaVYifjVXQxGXhI+fDq7i1/jlh2oLrlgGPGRnU8AufifNQh9Qlz+pSns4vglfMteJQNh0QMWNEqMKRv1DDtruqJi71wBGUCQscN1jZvm9i+AelvdNMx1IUvNsyutq3YiKiYKy+DgxXo4e1FK7Z7BdGxMWl050gZ75200XPsye3AG6yrcYoKeqgUA8U/crJPgwB58V4g3UIepsimtwTleP2gHappACVenYha6+UnMrdOydjNK5I7W0iFk3Ls+AWKYCj7BP2oXKL4LWLvFJ0hZ7dHUUMIo3t9kdvOzAoY+I4ZaVG/7Sa1gl/hYvA4kn8if1sPI3Qp6l1tdT0qJDucysMr0w/fI10I9KwaXWytxKXHhSHoY2sL8So0+X0tOvubV/XQq4KR0U8ZgX1PzsewbLUfiGAZdj3mu/IWwLesSE/odQK3ckWC1ABoojatI+xyZC O8KOnekR iJQnT4ebCoQlyGMQiBrHXo9KdOYT8NwYcWVMf++meZUZQamrp+MoYhlcJ413g1H8HVYtAK5jNW3MhpI1fVmKR3mvCvIgsRYIJytBJ5CmK/x+oV6w2Lrr6fTOoWbuVTF8PuwHBj6dgdAkzZbFTA5CT1+E3uxFOyCnLDDY0CE8/Ps7Fg3RZCZ3ZvUVxSPC2WR7+R/Fs8BIZDm6WVnZrj6duEF657sSg6mq/w+TG7UkhFauwT+W2SnybXBx/wGgP149F43pJhpdl8Ly/TDtLOlY9DB2qIc2xXx0Yk7yeB2mG8Xzj9K3FT+WGD2TzWdWP8OTHHHECcULFNWPLBf/ead1qS66Ow9kt6K2S9OJLH8i/u/8ANhw= 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 2dfc9f716e3b..02f6e179b7bc 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") \