From patchwork Thu Nov 9 15:39:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 163422 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp521472vqs; Thu, 9 Nov 2023 07:42:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGYSGp15QnH3T2Ig2ZBXKWc0ulNU582XsyMDNmyckTCDCe/HeVxqOjA9EUdQYlFQ2flcT97 X-Received: by 2002:a17:902:b612:b0:1cc:65bd:b453 with SMTP id b18-20020a170902b61200b001cc65bdb453mr4830892pls.32.1699544570190; Thu, 09 Nov 2023 07:42:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699544570; cv=none; d=google.com; s=arc-20160816; b=b1vZm/VF9qtNu5xhGsfnr2CD0UGzeAVdEjkXDs3VcvN63Fp41+5W0Wm75Rg1VcdN9n mkVDxFTReoKNdLTsHfqCb5f1uI4VioOOvo60qdqRVWuFLBCNmnkR15RHTHKK25QpbVs6 Y9LekPhUUG0sAZv6jVdK7kIKK+EZehadBXdd1HzK1ZGFFd3/44dgnqvJ+B5qlioqPFvM G8TO5FhBT324RwG1IrygEBT7VrX3DrdUTjn9wBZLduitY7+2l6qryK5oykpSWBgcXqk1 HoF7WtNRaFB4+X8VpWluCd9VNaGnuc+HSQQ+hnCkZDhMdQWrrfkFh2la9vuDYQ8EYNlE 475Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lwRdN9r8m/J8OsPVvLUXF8vAvTPiY2k6pt1MGY6dBcU=; fh=9hT4l0EMR1D2zdgUoRXiqFwsybSJyrmM/FC/blQlPsI=; b=Rpaw765SHxS3p7/fMC4Y/F+VldmZ8AP9p2VfkU7Pnw8myPGYAIXyMnrAsq6o7yWUrr rKfAkHexJqn9EMaeMsuBEMCBr1zvBusnJIvSkKYLwbEbkVpE10nZB4UEXeYL2k8h5vdx LeY3/mm4gzqNVoeyoXTxsdPQvBlQ3o5IeVTNncDLQKJ61wbJ2VeJizew7w60nweylxRZ wxMjnMsSKEFlQpLA+9WJAlVq/w3HFsfN48/vBltiTfcX76sJhzKrx92xiBrOesvBB3Mg agB4g19hLvyLvDq7DNqJw0DwHwLuTIEi/eW/WSLwaCF5X2jlDX8W/Zz4hxIXnoe+Ifb9 VsXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Cl7YEqAT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id p11-20020a170902e34b00b001c9ad30e4b8si4589247plc.320.2023.11.09.07.42.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 07:42:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Cl7YEqAT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id EF6088040EF1; Thu, 9 Nov 2023 07:41:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343630AbjKIPlR (ORCPT + 31 others); Thu, 9 Nov 2023 10:41:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234513AbjKIPlJ (ORCPT ); Thu, 9 Nov 2023 10:41:09 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52FA52126 for ; Thu, 9 Nov 2023 07:40:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699544420; 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=lwRdN9r8m/J8OsPVvLUXF8vAvTPiY2k6pt1MGY6dBcU=; b=Cl7YEqATGt7EKz/dvvQhetEGMWT4lYVipn2SNXitiPtn7vdmA7VY688+ZZN/JvcG8AblgL BsypmnYj7uOJUzq/56KGHPnrYg1Lwhxsj8QCTSpoyfNc3WUXADPklODWeYNfz36AmxprXI eTG4JwiGWfDxHkInOJDccurPsMYAD0A= 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-586-7fC5TsCzO-qeexNDnZzwrg-1; Thu, 09 Nov 2023 10:40:15 -0500 X-MC-Unique: 7fC5TsCzO-qeexNDnZzwrg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 1DE04828AC1; Thu, 9 Nov 2023 15:40:15 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5797D1C060AE; Thu, 9 Nov 2023 15:40:14 +0000 (UTC) From: David Howells To: Marc Dionne Cc: David Howells , linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/41] rxrpc: Fix some minor issues with bundle tracing Date: Thu, 9 Nov 2023 15:39:26 +0000 Message-ID: <20231109154004.3317227-4-dhowells@redhat.com> In-Reply-To: <20231109154004.3317227-1-dhowells@redhat.com> References: <20231109154004.3317227-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 09 Nov 2023 07:41:27 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782101647173888491 X-GMAIL-MSGID: 1782101647173888491 Fix some superficial issues with the tracing of rxrpc_bundle structs, including: (1) Set the debug_id when the bundle is allocated rather than when it is set up so that the "NEW" trace line displays the correct bundle ID. (2) Show the refcount when emitting the "FREE" traceline. Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org --- net/rxrpc/conn_client.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/rxrpc/conn_client.c b/net/rxrpc/conn_client.c index 981ca5b98bcb..1d95f8bc769f 100644 --- a/net/rxrpc/conn_client.c +++ b/net/rxrpc/conn_client.c @@ -73,6 +73,7 @@ static void rxrpc_destroy_client_conn_ids(struct rxrpc_local *local) static struct rxrpc_bundle *rxrpc_alloc_bundle(struct rxrpc_call *call, gfp_t gfp) { + static atomic_t rxrpc_bundle_id; struct rxrpc_bundle *bundle; bundle = kzalloc(sizeof(*bundle), gfp); @@ -85,6 +86,7 @@ static struct rxrpc_bundle *rxrpc_alloc_bundle(struct rxrpc_call *call, bundle->upgrade = test_bit(RXRPC_CALL_UPGRADE, &call->flags); bundle->service_id = call->dest_srx.srx_service; bundle->security_level = call->security_level; + bundle->debug_id = atomic_inc_return(&rxrpc_bundle_id); refcount_set(&bundle->ref, 1); atomic_set(&bundle->active, 1); INIT_LIST_HEAD(&bundle->waiting_calls); @@ -105,7 +107,8 @@ struct rxrpc_bundle *rxrpc_get_bundle(struct rxrpc_bundle *bundle, static void rxrpc_free_bundle(struct rxrpc_bundle *bundle) { - trace_rxrpc_bundle(bundle->debug_id, 1, rxrpc_bundle_free); + trace_rxrpc_bundle(bundle->debug_id, refcount_read(&bundle->ref), + rxrpc_bundle_free); rxrpc_put_peer(bundle->peer, rxrpc_peer_put_bundle); key_put(bundle->key); kfree(bundle); @@ -239,7 +242,6 @@ static bool rxrpc_may_reuse_conn(struct rxrpc_connection *conn) */ int rxrpc_look_up_bundle(struct rxrpc_call *call, gfp_t gfp) { - static atomic_t rxrpc_bundle_id; struct rxrpc_bundle *bundle, *candidate; struct rxrpc_local *local = call->local; struct rb_node *p, **pp, *parent; @@ -306,7 +308,6 @@ int rxrpc_look_up_bundle(struct rxrpc_call *call, gfp_t gfp) } _debug("new bundle"); - candidate->debug_id = atomic_inc_return(&rxrpc_bundle_id); rb_link_node(&candidate->local_node, parent, pp); rb_insert_color(&candidate->local_node, &local->client_bundles); call->bundle = rxrpc_get_bundle(candidate, rxrpc_bundle_get_client_call);