From patchwork Fri Nov 8 17:32:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13868575 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 B065FD64070 for ; Fri, 8 Nov 2024 17:35:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4281A6B00BA; Fri, 8 Nov 2024 12:35:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D7FD6B00BC; Fri, 8 Nov 2024 12:35:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 278AC6B00BD; Fri, 8 Nov 2024 12:35:00 -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 06F7B6B00BA for ; Fri, 8 Nov 2024 12:35:00 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A8AB4C0F17 for ; Fri, 8 Nov 2024 17:34:59 +0000 (UTC) X-FDA: 82763627940.02.30322D4 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf22.hostedemail.com (Postfix) with ESMTP id DFCFDC001F for ; Fri, 8 Nov 2024 17:34:11 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HXop7MyB; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf22.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731087237; a=rsa-sha256; cv=none; b=BVyFtDyUA7l9PfB86Ry8RDm1GyQymqTlP/kW5YEZBdI9paRUPLfUDapGq9VSptjIqXF2X6 Prg39klInITquheGGDGYl9hUesT+/d+Pt5Bp1LxF15dK/7uI3Uj3B0doA86ricVvHlzVbC frIHcFAYYeI2uPHXZK8klFCD8JUpsmI= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=HXop7MyB; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf22.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.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=1731087237; 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=YiW4YfbUekIkX4PY3zjR7RhUMGnhQWKbJaqTUJa3b2/sOREnFVfNOfBAF+f9jX7nFo29O8 yNuiKGu/eOa4eFr32epjr9hcGVhamMxa/MWbd5Z5qollF5OnfdGsWDltvOQLJPWc+IT1L7 M/p/q3Pa6dW1R42AeRPFzhsHdEgteS0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731087296; 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=HXop7MyBq9yZKvqHvIbhEsobFzxDC8SEIhrXOLOurlJXCYKQzqj75p02yQDmbGMSFeB0Mv MIxoIpcndB139MgLr5uNA0V2qUevCQ+UYxXxuXOan9AqlNtfPNdd/jwHGQPlIsjXXFNxCB KlhyPTnZDmyp7Biv9PCwQc/P47R2v8w= Received: from mx-prod-mc-04.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-230-utFlB_VuN8Sv2_-v1sEaMg-1; Fri, 08 Nov 2024 12:34:52 -0500 X-MC-Unique: utFlB_VuN8Sv2_-v1sEaMg-1 X-Mimecast-MFC-AGG-ID: utFlB_VuN8Sv2_-v1sEaMg Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9D7EC19560B5; Fri, 8 Nov 2024 17:34:48 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.42.28.231]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id EDDA1195E480; Fri, 8 Nov 2024 17:34:42 +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 v4 17/33] cachefiles: Add some subrequest tracepoints Date: Fri, 8 Nov 2024 17:32:18 +0000 Message-ID: <20241108173236.1382366-18-dhowells@redhat.com> In-Reply-To: <20241108173236.1382366-1-dhowells@redhat.com> References: <20241108173236.1382366-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Rspam-User: X-Rspamd-Queue-Id: DFCFDC001F X-Rspamd-Server: rspam01 X-Stat-Signature: cjbrzqo4yozuziwpb5x4bfbujahmdi6a X-HE-Tag: 1731087251-305457 X-HE-Meta: U2FsdGVkX1+ni3TFdSyPu2tL+Gm6kwNYYaQHUV7LRQo/r1xAFujNBfjrc+O2Xg2zEQLMdvj0vSX8msO+gSELr4Qi3CiqN5QuSfL+zE8cPFF/HZM9b98+5ayDtgjFOdIbtZHqlV0cV48P58JfS2KB6R0f4bCcFKS/mdFy52r3lWfNOTRVUKy6pqQDysVRGfjzKViHDjG/n7DMw+DmhEkcmn4dLBNZFVxywUYj+pbrYGiyC1QbqGUztoaaxbhnIcip3g3x3y8v2amuubsM2q1Mz81Y6w8yRazCE2DHkIWXzAIJuBjM9Nnmfc2bTN5YpNez65plWBtb5AbQyUZvpKe4wEr4PQGAdUZq9HyEgEWnj6/TgPYN59BKOhkbj4IUQ7Fqtuchrfnddo1oNXZSXjxkSZpjF4a+QbU3C1Mg1ujXQ0byhPsqhVOFlCdF1Uu284YLlKl/0r/yg0oS+zKvDI+X7ttOpZJCtwqt6SAG3yeU8lo+7MKQvv3bfwsQYb9rz0NEGxY8y0v1UvxFgxmP1I4uA13fxEYQ2d6yAE+Uei63tRELfpEZEUhmpGmuQrgGrrzUv45CLIdew6PhC3TMnOfSJTASSgoDKjEdOm08XwsAYvM+qSshHrIUfsSdvjCexFqSxhUNelt8pzzBqzHDcE3aFucPot3reCHR//QYikDPDtvFyAatjXZEbggx1qLsRDKFKpiFUwvMg8YjS4IcC0BvMD2KBqftgsStE7m/w95XbEqCS0CjjUyvBVNIHyp5s6GuESDUjIlZlFbffdJUvpFYRBgTuUJ09NsyQxGXKYrjXlJIzDBKHSVEy4LJqvD8D5q32z293pcjkgqq26Kh+r0Xb25mZyxKil5ktekw5EBxr3+loMHFzBnSavsPE8t3bu6o+Z+dOSn+sVpjGmvlj8R7PzwwsWypKYYLROu9R2pdNMmkaUY1aYiBDGemQwhWVr+jD9Ux8qqVfVJLf9F10C5 vA5v+zzq EgAf/No7E4NghFbc2PO6w3iHvPYzikht7GpChj3I/5aPFS7orh6cumwwd68YrXRuG7BFWpwuOos9yDsNxRK+9K7Xd0N1vt99kBjJ1KOZAoVFsj3OIyB3dj4Ngr+SnatVu4dXkdB0eVhETuymPWizDaCBCBG0nJC+/erCMZFt/9CNglqF6ytgXNSRjP5y4fYTlKvfqhOp0ur0nKOuW0EoM+ZT1TDpDi1IZf24MuY6vbFTU+R6JpXYwL05trBOmAqbIje6qDj6kkFqHkCiBO3NdP6YeIP8T9d4KBEmiJV5W3WNYs3M5xmB0E8daHag93/60pMBjE8GcOHj6RDQeMahAWoyjkY8PHmRGGCjW8JoVH2+rkro8kGiJdu2kA/gSQtraY6dDAW8VgcSOAdnWEfTQ1NAFvqRcFaMK6S/fbAlfj8qc6kxbgF9TRPQbzw== 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") \