Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1971815ioo; Mon, 23 May 2022 07:19:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzz8jUkeLKRzrRJ2q4SQ3ljrmzP6RDFFwZGZTMUP0gW8K0lubxbjbbonepGl+GRLiG1gvzE X-Received: by 2002:a17:90a:f3d5:b0:1df:2191:5ad2 with SMTP id ha21-20020a17090af3d500b001df21915ad2mr27154916pjb.136.1653315589787; Mon, 23 May 2022 07:19:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653315589; cv=none; d=google.com; s=arc-20160816; b=MkEBXImEuc96kz7ltLQoaYKQFGNa1ObvSdCYmOstTa3uzgYmn3NLimS03JxnnhSmRr 49xcc7b66sDO0PiLfgmLNoc49jqpNcIkdHbh6UO6DtiCc2J1xCYVdrErVBheIKzfQH6f YxwaxD9EbchWVz2dwvsGBy91LdUDQG1Y8Y2qLneMrWIVzrf59CMbskxVJsigZwfmFbOJ q6Njvn7F52E2MzsZoEhUmmxQXu24wcCNHIsO6UexwvddRhyZdz3iiIJPMmGGOjnld3f/ X7uU+gvXdstyfJLL+8XAKzN4N4aN3vY1SyH9/0n9VCj4SoZLH7ihF4BlA7tlOtG8Y8Cr eLQg== 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=OdNib6xHnYB5XJQ8EWNTDexkpSG6zLdl/z7jRrlRWQA=; b=Sepf2GbwAAyF5o8437vr2pqBW7ZpErYoyW53sQdGlwUz+5wMljLvn4HgWmgQr1WXKd mdmFrSd7r66BhE32CKF/4E8gifzlaMDkfCW/P7bwaaKqX3eBJuWfLtacp3GEJlMPRTSr 1YS6RL9aiyjMD2SiYL1qZzsuwxsUEUJSlDh9SXAJYGV8xtIJCWAFTewvUo5tAAkfRe1O ufK42VPgcJg/petgtO/4s7RBSK4+RqJIcnkymVLHj2RE6rOQhis0euKuRqott0CtlSet WgTD3jYdoEoHliXD0htxe0wRZZ05lNGtd/Sd2P8BFnZly+x51wTGRCCb+AZ9Sn+QKDz9 bfug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@corp.netease.com header.s=s210401 header.b=ihna4uwG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=corp.netease.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id t20-20020a63dd14000000b003db48a0c6ecsi8459468pgg.792.2022.05.23.07.19.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 07:19:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@corp.netease.com header.s=s210401 header.b=ihna4uwG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=corp.netease.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9AB835A08C; Mon, 23 May 2022 07:19:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237072AbiEWOTU (ORCPT + 99 others); Mon, 23 May 2022 10:19:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237067AbiEWOTT (ORCPT ); Mon, 23 May 2022 10:19:19 -0400 Received: from corp-front10-corp.i.nease.net (corp-front11-corp.i.nease.net [42.186.62.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09C6B5A088; Mon, 23 May 2022 07:19:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corp.netease.com; s=s210401; h=Received:From:To:Cc:Subject: Date:Message-Id:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=OdNib6xHnYB5XJQ8EWNTDexkpSG6zLdl/z 7jRrlRWQA=; b=ihna4uwGp6mc8Z+kPc29T2XEumkxn/QCTfzeP7ozw/AecMdCZa lGe1VR3USjBUNaxRiedVrrtSvFdM7h/X7KASHmrIhhBxwJRVOROU19DgYWJASy/2 sh3SFLUlzoVAffzlbx25lAIoNVBvGdVw7C98fP0VEPBwDhgECbpgXxopY= Received: from pubt1-k8s74.yq.163.org (unknown [115.238.122.38]) by corp-front11-corp.i.nease.net (Coremail) with SMTP id aYG_CgCXrV_Zl4tiHYEgAA--.5304S2; Mon, 23 May 2022 22:19:05 +0800 (HKT) From: liuyacan@corp.netease.com To: kgraul@linux.ibm.com Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, liuyacan@corp.netease.com, netdev@vger.kernel.org, pabeni@redhat.com, ubraun@linux.ibm.com Subject: Re: [PATCH v2 net] net/smc: postpone sk_refcnt increment in connect() Date: Mon, 23 May 2022 22:19:05 +0800 Message-Id: <20220523141905.2791310-1-liuyacan@corp.netease.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <5ce801b7-d446-ee28-86ec-968b7c172a80@linux.ibm.com> References: <5ce801b7-d446-ee28-86ec-968b7c172a80@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: aYG_CgCXrV_Zl4tiHYEgAA--.5304S2 X-Coremail-Antispam: 1UD129KBjvdXoWrKry3tFWUtFyDCw1kJw13urg_yoW3twbEqr sIkaykGr1rWrZ8W3WrGr4rGwsr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Y4v20xvaj40_Jr0_JF4lIxAIcVC2z2 80aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI 43ZEXa7sRiE_M7UUUUU== X-CM-SenderInfo: 5olx5txfdqquhrush05hwht23hof0z/1tbiBQAPCVt760qFUgAZsM X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 > This is a rather unusual problem that can come up when fallback=true BEFORE smc_connect() > is called. But nevertheless, it is a problem. > > Right now I am not sure if it is okay when we NOT hold a ref to smc->sk during all fallback > processing. This change also conflicts with a patch that is already on net-next (3aba1030). Do you mean put the ref to smc->sk during all fallback processing unconditionally and remove the fallback branch sock_put() in __smc_release()? > With the new patch on net-next it would also be possible to detect in __smc_release() that > the socket is in state sk->sk_state == SMC_INIT but the sock->state is SS_CONNECTING or > SS_CONNECTED and call sock_put() in this case. > What do you think? Oh, I didn't notice this patch on net-next. Emm, I think I need to do some testing with this patch. Thank you.