Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2744468rdb; Wed, 15 Nov 2023 09:16:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IErgSg28FEqiqCHwt2EiJ11gJrCvcBjIIbh7wG8NYrgC2E9cuhrsywPlJBUHnJZKNoy4jTv X-Received: by 2002:a17:902:9343:b0:1cc:7d96:3fe7 with SMTP id g3-20020a170902934300b001cc7d963fe7mr6009297plp.28.1700068564670; Wed, 15 Nov 2023 09:16:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700068564; cv=none; d=google.com; s=arc-20160816; b=jr8geQ4kam/mj6o53u4hdACqCVjlAydIp82MsmgTeDl1NYLz0ZA0sk+2Cc69+umhdQ 0B4y+6gSCFgyIdhdiDIlEzBTNzcEn7FXY4ZUoTYJLnuGVraHs+iYp9bwYL1U5Gb9WdZJ eHI9RlOCh1Yd14igvx+BzjYYE7Hz0I8iYKT3KIVNTH4k2d3HrUD0XRqHFHSp02HSRWvm s4aWPBy8Bk4crsjo4gL5poxlLsDhZTnBkPCxDFRvsMJOVFCPGlASH/KaGPyFVXND7pFO ivMHvhTi6UwvO1do9PCGLAhSwNAJlDtM3whMkZPURLOEIJGgOmbqJGLMhSqVos4ms3em sS6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-transfer-encoding :content-id:mime-version:subject:cc:to:from:organization :dkim-signature; bh=l0183wfb6QQa7Dify3mlCQ9wLvW15z5Q/GXKekFiQGQ=; fh=R53BNol5gttsC8sHkxK5xW6DkH4Gze00u3bi++HSWzU=; b=q2dACEIIdUDNlUyOT5AOv8sURAgxp8ggy1AzRwebRxvCJtMfSfLsNmBQLQ/64K0v4f Lkf8KWj9TEovJVpqnimXBN1zZLXG5LEUNfvndulg9LnEEIxocMLKStu4EgTh+6xbYWjR HaxZa4cak9NJM4/ooUSnlouvP0hhHKNiZkUhol6WuVDstJnd/fGhMc96SHbN6es9vIXI igJNlkJev1yAcSjYSr7YZyf6+4234LYWWt+3Q4bryFr5Ep9auHuMlHUeGTpHgwW/6FxO 3IqKYi16iP4Hsr9YJ1M194qLrYkd8HBz6uyJWnB2hynGs4ZqhOg9eT/XDOQdGkWCT8Xo +c1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DRQrYT71; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id u8-20020a170902bf4800b001cc54873f98si10039796pls.149.2023.11.15.09.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 09:16:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DRQrYT71; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id A7A748096A43; Wed, 15 Nov 2023 09:16:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229585AbjKORPv (ORCPT + 99 others); Wed, 15 Nov 2023 12:15:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229504AbjKORPt (ORCPT ); Wed, 15 Nov 2023 12:15:49 -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 B0B6EFA for ; Wed, 15 Nov 2023 09:15:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700068545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l0183wfb6QQa7Dify3mlCQ9wLvW15z5Q/GXKekFiQGQ=; b=DRQrYT71KL2udeptzx5bNi3MiWtEcbfqU9wCxrhOQqc42Xqzu1i8iu8CyitbF39Z4+IABN S3frCR+SfWxr+xNOoiwSTBTAVlyjgUdQrdcmNz4YytkYkuQk2Ltao2Y3PPC7M24HUoxuLp olAF0U3I2v/dF7VNKCqE7ooLV0yq0n8= 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-186-NuvpSifpOSqIylCwNS7D0A-1; Wed, 15 Nov 2023 12:15:42 -0500 X-MC-Unique: NuvpSifpOSqIylCwNS7D0A-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 02E2F3C000AA; Wed, 15 Nov 2023 17:15:42 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id D4BBA1121306; Wed, 15 Nov 2023 17:15:40 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells To: netdev@vger.kernel.org cc: dhowells@redhat.com, Marc Dionne , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net] rxrpc: Fix some minor issues with bundle tracing MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3939792.1700068540.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Wed, 15 Nov 2023 17:15:40 +0000 Message-ID: <3939793.1700068540@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Wed, 15 Nov 2023 09:16:02 -0800 (PST) = 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: "David S. Miller" cc: Eric Dumazet cc: Jakub Kicinski cc: Paolo Abeni cc: linux-afs@lists.infradead.org cc: netdev@vger.kernel.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_l= ocal *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 =3D kzalloc(sizeof(*bundle), gfp); @@ -85,6 +86,7 @@ static struct rxrpc_bundle *rxrpc_alloc_bundle(struct rx= rpc_call *call, bundle->upgrade =3D test_bit(RXRPC_CALL_UPGRADE, &call->flags); bundle->service_id =3D call->dest_srx.srx_service; bundle->security_level =3D call->security_level; + bundle->debug_id =3D 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_bun= dle *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_connecti= on *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 =3D 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 =3D 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 =3D rxrpc_get_bundle(candidate, rxrpc_bundle_get_client_cal= l);