From patchwork Thu Mar 28 16:34:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13608975 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 DBF6CCD11DD for ; Thu, 28 Mar 2024 16:36:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6C10E6B00A8; Thu, 28 Mar 2024 12:36:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 64DA46B00A9; Thu, 28 Mar 2024 12:36:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4C4276B00AA; Thu, 28 Mar 2024 12:36:45 -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 2A14A6B00A8 for ; Thu, 28 Mar 2024 12:36:45 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id E7F05160D9A for ; Thu, 28 Mar 2024 16:36:44 +0000 (UTC) X-FDA: 81947001528.24.DF49B24 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf27.hostedemail.com (Postfix) with ESMTP id 2DB2840003 for ; Thu, 28 Mar 2024 16:36:42 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=itPO4NVi; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf27.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=1711643803; 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=SL4EWbx4NBAGR5Ppiq2v7C/YTDepZ3O+7v26rOrM0n0=; b=4vjPEuR/iFJzyUFIZY/RX/cRt210nc4aK5MwMSEeNaraFyHI+X1V7u5oTZWdZ19OudfQ3x KPWQrPXSDO9MvdFX74WMVtwYIfftAKxdRNQmDTNnQRnKfK08rJWEKbdaPMzbLn+jizNdCI Bb37btNXr/wdypx/A1EqfrcTlqBW8u4= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=itPO4NVi; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf27.hostedemail.com: domain of dhowells@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711643803; a=rsa-sha256; cv=none; b=XG8T8lxy8a8+Rhu+KikDyFBxECzCzk0ADkmYoQEz0DU3t12xbKtDNzyCuwLXN1qL63egf8 rzBIT5qNtaVnmOGQSYL85JLc6+Zx6Xa5cO6XkjbNd+Fo5sW1x46M4AqIK3hDWWapm50xQ2 Woi1sibH5tcmAN4UqP2WKq7n81AIXPI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711643802; 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=SL4EWbx4NBAGR5Ppiq2v7C/YTDepZ3O+7v26rOrM0n0=; b=itPO4NViqo1aNHwbb0hxh6FylaQuD6l1klE7EdClK+BLKdzAxD/TFoSbeb+0qZoSiBabRB hLjHsWsl9DE6jrooUxeRY9blG90jvqDSj+x1jKUa8QX1YEGz9xdE31NI+XPynLgbuYLDCS pOvhWqmBqdE2s7wXPPVCKbn0GBK5+eg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-221-ChXRkUr0OMqFZ7Fb17h45A-1; Thu, 28 Mar 2024 12:36:39 -0400 X-MC-Unique: ChXRkUr0OMqFZ7Fb17h45A-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4165985A58C; Thu, 28 Mar 2024 16:36:34 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.146]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C6FA111F3C6; Thu, 28 Mar 2024 16:36:31 +0000 (UTC) From: David Howells To: Christian Brauner , Jeff Layton , Gao Xiang , Dominique Martinet Cc: David Howells , Matthew Wilcox , Steve French , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , netfs@lists.linux.dev, linux-cachefs@redhat.com, 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 08/26] netfs: Use subreq_counter to allocate subreq debug_index values Date: Thu, 28 Mar 2024 16:34:00 +0000 Message-ID: <20240328163424.2781320-9-dhowells@redhat.com> In-Reply-To: <20240328163424.2781320-1-dhowells@redhat.com> References: <20240328163424.2781320-1-dhowells@redhat.com> MIME-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+h2c5JZphnnOaQu8/qm+8YqERewGL4uXQX4g+vIQ1GUKfscd66oxt1HZZKJIJ/42FqIG6wg FDIzBetk jE4Ra6ociPqzojC5hmlKLHExNuQMJF+IS/dTEVO5N266Vi7YQNzK/g/1mSl23rvHbfW2L6mok82LCI3Ryl7t09droZhHP/7MHwhMjF9CAjrUAPaI44QCUMcnj2BgUsinzSyHWrPH8J/1YzGC6n9DtLZaxLuoRiUc6LGIg99CueQ9Pkst3ADTTjkyrse22uqZ4BaQFULX9jNarNNx+p6jsYc0o0DsU/EQrVPGINziJatq80zBoqZ/ahNL7Dc97fc84yWVKUhzw+ha5tBDwva90PsiJC6Af4Lc012w0LAO0Q4zRhla3O1A2Nn17lg== 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: Use the subreq_counter in netfs_io_request to allocate subrequest debug_index values in read ops as well as write ops. Signed-off-by: David Howells cc: Jeff Layton cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org --- fs/netfs/io.c | 7 ++----- fs/netfs/objects.c | 1 + fs/netfs/output.c | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/netfs/io.c b/fs/netfs/io.c index 2641238aae82..8de581ac0cfb 100644 --- a/fs/netfs/io.c +++ b/fs/netfs/io.c @@ -501,8 +501,7 @@ netfs_rreq_prepare_read(struct netfs_io_request *rreq, * Slice off a piece of a read request and submit an I/O request for it. */ static bool netfs_rreq_submit_slice(struct netfs_io_request *rreq, - struct iov_iter *io_iter, - unsigned int *_debug_index) + struct iov_iter *io_iter) { struct netfs_io_subrequest *subreq; enum netfs_io_source source; @@ -511,7 +510,6 @@ static bool netfs_rreq_submit_slice(struct netfs_io_request *rreq, if (!subreq) return false; - subreq->debug_index = (*_debug_index)++; subreq->start = rreq->start + rreq->submitted; subreq->len = io_iter->count; @@ -565,7 +563,6 @@ static bool netfs_rreq_submit_slice(struct netfs_io_request *rreq, int netfs_begin_read(struct netfs_io_request *rreq, bool sync) { struct iov_iter io_iter; - unsigned int debug_index = 0; int ret; _enter("R=%x %llx-%llx", @@ -596,7 +593,7 @@ int netfs_begin_read(struct netfs_io_request *rreq, bool sync) if (rreq->origin == NETFS_DIO_READ && rreq->start + rreq->submitted >= rreq->i_size) break; - if (!netfs_rreq_submit_slice(rreq, &io_iter, &debug_index)) + if (!netfs_rreq_submit_slice(rreq, &io_iter)) break; if (test_bit(NETFS_RREQ_BLOCKED, &rreq->flags) && test_bit(NETFS_RREQ_NONBLOCK, &rreq->flags)) diff --git a/fs/netfs/objects.c b/fs/netfs/objects.c index 72b52f070270..8acc03a64059 100644 --- a/fs/netfs/objects.c +++ b/fs/netfs/objects.c @@ -152,6 +152,7 @@ struct netfs_io_subrequest *netfs_alloc_subrequest(struct netfs_io_request *rreq INIT_LIST_HEAD(&subreq->rreq_link); refcount_set(&subreq->ref, 2); subreq->rreq = rreq; + subreq->debug_index = atomic_inc_return(&rreq->subreq_counter); netfs_get_request(rreq, netfs_rreq_trace_get_subreq); netfs_stat(&netfs_n_rh_sreq); } diff --git a/fs/netfs/output.c b/fs/netfs/output.c index fbdbb4f78234..e586396d6b72 100644 --- a/fs/netfs/output.c +++ b/fs/netfs/output.c @@ -37,7 +37,6 @@ struct netfs_io_subrequest *netfs_create_write_request(struct netfs_io_request * subreq->source = dest; subreq->start = start; subreq->len = len; - subreq->debug_index = atomic_inc_return(&wreq->subreq_counter); switch (subreq->source) { case NETFS_UPLOAD_TO_SERVER: