Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp567199lqh; Thu, 28 Mar 2024 09:38:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXO6dDJLMssDD/qqY3Tjxe/qbfAwUZb7Fdy1I+5sKWzj5p4WuH0Dat0ghmAll6yr4kzgYFZ50wbP/B5v99czj2GRa4A2GAKU/zzXzzF4A== X-Google-Smtp-Source: AGHT+IHoEqQVGUPNuiItbHvCYYTE0MMalYyX0dupm3jq25RGBxOCa4q9yIxBSWSDAR+SLCDejkeO X-Received: by 2002:a19:f815:0:b0:513:9e13:6403 with SMTP id a21-20020a19f815000000b005139e136403mr2109673lff.21.1711643934308; Thu, 28 Mar 2024 09:38:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711643934; cv=pass; d=google.com; s=arc-20160816; b=RZjQDW2pW/iQG/DEiDXxms+j38evcajNklnW2Wsg+o/3HmlnVSFAdTNmb4VTibErkp 3GYObPczcrwgJm4rog1IAaa36eMRyzbawA9Xz8Ezxkicbo8xSa3LY4koYLB9Ej6mMC4z QMSXDV63Xun91mEY489EODyMhWtwO898F44hUIdbPqxq+RM8EILpwx/SwqVpY6HAYmAQ wmDzFl2DVA5uNwiBqwpr1EQltt8NZyFUw9G7As9CqTbRm68VtacItksTVlzHpltjriPs uPt5Kam3udGZw47G2PK/LvivrxF7IsE5sOuoeTK49FdSQUOgDn/jwQdAhNS1tt31egMt syQA== 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=ybC9P0n1dcpAte5eySEm6+xBUoDxxo5DvYYNaJCSh0qvL9zMuYjXfL4U1uhZK7EDkw VamiEIOZDgvG5GdvsklZZGrk63IRRK217zGGyPt8DC4zgCsCtzaUuHg4ONtjPFvbHEFG jwM8y5dI/XMiyKmzt9qNEuZuMRijFY5xG5nMZaszXlK14Iv1PL07pGFKjg6Sf7VgZ7vt dQ7eEcVxs9KyhppWv+wM3QSdA+44MQIQLZxGn6h7bK4SPqJ0YZ1z2jdKESXg8t8o6tW4 eaYYRMF/6kq6Vrs9thJkpmhdDXn4tXlWs/gd1+dZx2Cy2RYeluy5DXqppLBUW8Jt7xdg EDcg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=itPO4NVi; 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-2526-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2526-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a13-20020a50c30d000000b0056be932cddfsi920996edb.181.2024.03.28.09.38.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 09:38:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-2526-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=itPO4NVi; 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-2526-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2526-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 067341F251CA for ; Thu, 28 Mar 2024 16:38:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B2D013341C; Thu, 28 Mar 2024 16:36:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="itPO4NVi" 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 386FA7EF07 for ; Thu, 28 Mar 2024 16:36:43 +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=1711643805; cv=none; b=TqspXVhRNUFFx7ygf9ey6VUBZg0BtZpno36Qk4FNjDox2kjDJXvtRXep1+CErMzhyBuk0YjejunqoRTCoHc2mg7cr/oem7rz1x2ETCJr6v+xKl0DEiRwipH638tXf+SznW/fNSL2YeL9F2S2sqbVyNm2jag8EMGlQWdvHw8vkUY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711643805; c=relaxed/simple; bh=hfTpBenYXqn/yYZgL0VekIwKOYS296pHNOKURBLP4z0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ltZ2WEYzmnxN3lHZ0s1mJfKOae26QQcGBTGwOkXJEszRVBwJ/uwME8hkjer2pritdPcBTBl1G6+XZeFzoemJ2AN9nnQHoXW/ccFJXjz4XGTHHhFLHG75k+Gtefp61UJ3ttrQ2HUl1HY3vS0EvvNVPpREO8gFFBR3GU0wzWpNNH4= 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=itPO4NVi; 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=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> 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: