Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp385224rwe; Thu, 1 Sep 2022 00:44:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR6a89pZyO46r663HcFx9eCN09p7VRVjcY8+v5OH5dZwyPIj0sbBkvZxG6nkK9+sOj1DgI9m X-Received: by 2002:a63:eb46:0:b0:42c:4d35:1c8 with SMTP id b6-20020a63eb46000000b0042c4d3501c8mr13235499pgk.459.1662018277520; Thu, 01 Sep 2022 00:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662018277; cv=none; d=google.com; s=arc-20160816; b=g9tDe7hdmTGSMJfGL+atldXEEEjIh/Ro+Z7a7BUdZ0LmQrPg3w6heZsTQVjUPwFUim hk7DXRY88QW1V0QL/ikILUj2+NK2oOLlkni+lzANOyYDGcUbEC55qXmb0cNP3f1pz+n1 ArSSSMZ3EGte89Se6tRFOWA5iwWy6bBu9eNGBoiHRhjFzxbtxTnlnH3+2ngY3kc9fKq6 U1O7KVgmnH4HkYePBNnF4KB0woB1pO8ay29MQqSbWMdtoe/bDT/Zbq49nRlA7W3wwmpD i3GELwTxwtRX/8Kw714grtiKDmnOw0OVuNTvM5ucYwkceblpqm+HjXNvdeaHy7vBlsV3 GhHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date; bh=XGbI2o7VWkSSwruNXSSkACcEhkRe3/yapDjbM+kRYUs=; b=zY1ocG3/NL8EZSZLJJit9VAyOnHxMn7sSjV8VszMq+lFpxD37fLBOm4h/2x7tCNgOm YLmtgA10wu1OEjggvUTsNlijiB5etEyNaO/g1Wiq00MYRlaWbCIPidZAbkvyhNKFCPcb h8VBBOIT40q1VE0mIIIwKABk6OA+8BUG9a6KtFj8VCKkcdPlk5FX3FH5NVB/Drnf8dQC dwVwB5dqVRzEQvYOBkCsWdu+sgUX98paSsynm7K4ZRKyS+Ho2ZkTsa8Gq/1BKHhReXBW Ws3m6YjFPCBLF8dwbainABs/sfEqtvGPLu48DuzgYIISb1g2HIhWsgCuF21lVPKUXwPJ fizQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s36-20020a634524000000b0042b57d7bc18si6824012pga.414.2022.09.01.00.44.26; Thu, 01 Sep 2022 00:44:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233326AbiIAGuN (ORCPT + 99 others); Thu, 1 Sep 2022 02:50:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233376AbiIAGuM (ORCPT ); Thu, 1 Sep 2022 02:50:12 -0400 Received: from out30-56.freemail.mail.aliyun.com (out30-56.freemail.mail.aliyun.com [115.124.30.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E5672E9D2; Wed, 31 Aug 2022 23:50:04 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045192;MF=tonylu@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0VNxyTX7_1662014999; Received: from localhost(mailfrom:tonylu@linux.alibaba.com fp:SMTPD_---0VNxyTX7_1662014999) by smtp.aliyun-inc.com; Thu, 01 Sep 2022 14:50:00 +0800 Date: Thu, 1 Sep 2022 14:49:59 +0800 From: Tony Lu To: liuyacan@corp.netease.com Cc: davem@davemloft.net, edumazet@google.com, kgraul@linux.ibm.com, kuba@kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, wenjia@linux.ibm.com, hwippel@linux.ibm.com, ubraun@linux.ibm.com Subject: Re: [PATCH net v2] net/smc: Remove redundant refcount increase Message-ID: Reply-To: Tony Lu References: <20220830152314.838736-1-liuyacan@corp.netease.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220830152314.838736-1-liuyacan@corp.netease.com> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 30, 2022 at 11:23:14PM +0800, liuyacan@corp.netease.com wrote: > From: Yacan Liu > > For passive connections, the refcount increment has been done in > smc_clcsock_accept()-->smc_sock_alloc(). > > Fixes: 3b2dec2603d5 ("net/smc: restructure client and server code in af_smc") > Signed-off-by: Yacan Liu > > --- > Change in v2: > -- Tune commit message > --- > net/smc/af_smc.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c > index 79c1318af..0939cc3b9 100644 > --- a/net/smc/af_smc.c > +++ b/net/smc/af_smc.c > @@ -1855,7 +1855,6 @@ static void smc_listen_out_connected(struct smc_sock *new_smc) > { > struct sock *newsmcsk = &new_smc->sk; > > - sk_refcnt_debug_inc(newsmcsk); > if (newsmcsk->sk_state == SMC_INIT) > newsmcsk->sk_state = SMC_ACTIVE; > Thanks for this fixes. I dig into this sk_refcnt_debug_* facility. It seems this is a very old debug methods and doesn't help a lot for sock leak issue. Maybe there is another method to help track this issue? For this patch, It looks good for me and tested in our environment. Reviewed-by: Tony Lu Cheers, Tony Lu