Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2048731lqa; Tue, 30 Apr 2024 07:05:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVn5GFZEGMLH05Yuuvmcztfjgpn2Lsim1rzRvnty4zWPnci7kjE6glI8UFPkeinIHECq16sIyd4I0fPAUcH27uqRBvMcHlUjsSVJ5vFRQ== X-Google-Smtp-Source: AGHT+IGNCxehQ+WtK5UOXZ7McDXfdPael6sjNVfXVvntQYL9AJaoCDpPN8edWdVFU008PMtLYLXM X-Received: by 2002:a50:c045:0:b0:572:9b21:e0c9 with SMTP id u5-20020a50c045000000b005729b21e0c9mr1603096edd.14.1714485909190; Tue, 30 Apr 2024 07:05:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714485894; cv=pass; d=google.com; s=arc-20160816; b=FARhO8/UieOvPDe28ToAaHPInO3C2AM07LiVpkSRKq5QjiuCTXZ9zlCNBu5AURA3fW cEshmvsykPu2ncj0Yzt6reD/sLovHWBAKIWy2E+sfLDeYmAb3CbEHloBUF8x/57sd/dA O6bQo6wdoxZjTwFP9euyZzsAvfIjK4byatVzcybO248rBYlNo/AYrpBG7W0qvuTEmJ0y U8b/+SF/UosRlwU2XNT8Sgsd6LnX3tFJck945doMoqtXmhi4QaVPdMLXvcd62F+cvjQw 2cBmrKoI3zNXmXMxOHWTikQfA09+VG6SHR1zX18Qj9rRUAypWPT5tUWVE6CNngYF9+jm gzOQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=SL4EWbx4NBAGR5Ppiq2v7C/YTDepZ3O+7v26rOrM0n0=; fh=dijFYpEVp+4ijccmXeOrV1fnLJQjsqwgNfcTPuMjuvg=; b=s3aISSBFDACuPKNFnB6A+guaU0b4PmmPPVfYKE2JqkqZZy7MCDTyWuDZiqLoFAA8uZ mJ/UweQ1nMo508gsmHBjAKT4GP9vOCXDojBhX9ENA6lKAWKC2a/UOH57Aiq/RjKQkBQj 1i2rIBpNHZ9r9CwkoIyIZC8Z2whmnmjmx99KqSldEsZU9CzylbsfzlfLv6ZCA0rQA03g 0MekwRESUfpKR/TzTMMdaVObRl5jzUlmSU3enMxikXOOI2aEI/TW5Tqoi5Egf8qkkVke APHjz1zguWwoHj0EKCZlGhryl6ap9PdLtPKASFPORAgkEbcPtdowX038kpx/6fgcar43 zb2w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y6KBIAY6; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-nfs+bounces-3081-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3081-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s27-20020a056402037b00b00572a70fcc8fsi92821edw.104.2024.04.30.07.04.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 07:04:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3081-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y6KBIAY6; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-nfs+bounces-3081-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3081-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D33E41F22B82 for ; Tue, 30 Apr 2024 14:04:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6C111802D4; Tue, 30 Apr 2024 14:01:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Y6KBIAY6" X-Original-To: linux-nfs@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C1DD17333F for ; Tue, 30 Apr 2024 14:01:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714485699; cv=none; b=JULIGvFCWsYYYXq79yZYyizOG++ufwlTXn45IiXV2kl9WVztvPhj2BD/nQqMRhxVSTAenNy+i9PR7k9y0AuMtUunYhSWaGqooth+t3Ei8LGtrxOnQdbIFVIzW2UIUMjDuLr5icWUhTwYhpGv5eelolueKW587mEZBgzdDCuKfR0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714485699; c=relaxed/simple; bh=hfTpBenYXqn/yYZgL0VekIwKOYS296pHNOKURBLP4z0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U3QAxmjx8fWt47LiH4SVlOnv255MGdC8+TR6B9arxFGbmXkReB4RUwnFhsIFa+absg9TxoAjiM154cqadIivEs5wEDEfTxP8wWAFMqlZQCYA6KqHD01Q/i5oAC8434ZmP1PQXtTxxAPtngpA8C+7EiT162KgQ/L+JPGJ72oZQYg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Y6KBIAY6; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714485697; 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=Y6KBIAY6/GLv0XaX/Ml4kUCd+Gr9xgWlXXt6ArTFtgcH9haQiAdMieycLuhuuGHX+xiAg4 Af4XyZFX84JVCvW31mTuspkI6Q6QMxWZshCYrtA2OcPEQDNZpJaEBnJFaDIq4yFoNbq9J5 lJuDPNWb+x8o+eJLHm6TkoipOeZo134= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-529--TbzclIPMMi2MXLaTqf-qA-1; Tue, 30 Apr 2024 10:01:33 -0400 X-MC-Unique: -TbzclIPMMi2MXLaTqf-qA-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 A04ED1C4C385; Tue, 30 Apr 2024 14:01:27 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9BCF51121313; Tue, 30 Apr 2024 14:01:24 +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 v2 06/22] netfs: Use subreq_counter to allocate subreq debug_index values Date: Tue, 30 Apr 2024 15:00:37 +0100 Message-ID: <20240430140056.261997-7-dhowells@redhat.com> In-Reply-To: <20240430140056.261997-1-dhowells@redhat.com> References: <20240430140056.261997-1-dhowells@redhat.com> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 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: