Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1990880ioo; Mon, 23 May 2022 07:45:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+uS3hWH5JaDDcmdJZifBeaF3L8AjYEy4b2vXG9Y9rqV7rS5ECDofiltRofKCx55ykEkA7 X-Received: by 2002:a17:90b:164e:b0:1df:99f2:be51 with SMTP id il14-20020a17090b164e00b001df99f2be51mr26773050pjb.59.1653317125497; Mon, 23 May 2022 07:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653317125; cv=none; d=google.com; s=arc-20160816; b=dct94CWeAGBB9qK52o4exgSsAyU1qW2t8S9aZ3NrZ5e+LEx3ZpMkB7jein7z5WvU+z bAV0M3eH8FolD+xSC3VUqopLEroNEIorg7DPK65gxCQm9thc6oUpRsvncx7EaxeskWQe 1x6LT9y0WIoGtMvqwMOma59l7rIgaNPl/brP5HnktGrYUcMJkrzyDpWvLEjYeRhAI+FR 23cJBMXejXo7+nvi9tUvJuTXGsxRL0Nef8hhMGcktQzdcIvcZ2u7aGFiJzjn2DjZjQFq sOHL1WzDCYG20sE13fM4h2N5S6f2Wt5f+p0Ch49sGVY48xl6qEpAIqBxCfhcmthNiUJs llvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=6cGHlwlrnJy/ZsxuQfgFcfPK1pFXQCxiI7jNqHSM/2o=; b=dPuivkEtORTmCmRJgJOuwEvyBe0lWVoTUepWHrLzbvDwp6Pj/t3hi+SleRzUfV3AD/ gzEtStVviiYS+m1LjIQqXXM1G9y43/ndS6V5N9++B0cF6/wnFIPBBrSvDqUFJ9r9kNV/ cVIgYdBXPzCrUFGHeHimBq+IeA/hG4lZ88xql/jxvYlwmCU4g5s654pK8DqjGXBfl9vB Rpl+c67hdcVivEQKHX1n+ivF4j3gaw42i/06VDnz1vWQhW5uM9Dxc3kSQnFyDpTQMz9o VSRqMm0tKa0pb1DkFNA/25g6XeF0N05g3GaMGNtim/enfkT3cuxM7Fi77xPZHYSwzrQw 6xIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=p6ubl54P; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id l13-20020a170902f68d00b0015d9e665a81si11798652plg.521.2022.05.23.07.45.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 07:45:25 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=p6ubl54P; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 567812DA9B; Mon, 23 May 2022 07:45:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237289AbiEWOpQ (ORCPT + 99 others); Mon, 23 May 2022 10:45:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237143AbiEWOpO (ORCPT ); Mon, 23 May 2022 10:45:14 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1704E2981A; Mon, 23 May 2022 07:45:12 -0700 (PDT) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24NEh7Zu007499; Mon, 23 May 2022 14:45:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=6cGHlwlrnJy/ZsxuQfgFcfPK1pFXQCxiI7jNqHSM/2o=; b=p6ubl54P8qTCYr39of8lRGkgqnt/vOwtr524RUaCvRubz4/m4vtONmTiI1BSqahxqyqk MDIbxnkcK+17cTgSNcWAuj0ifjCXhBsn8cjZDFEYAXs5JrDCggOo5cFu5qLtmuO/PpCD hCejjWqBjbinfn7hOLuEqdb+hX3I19CdUva+ETsHAuLaSoOQdZVuWFmKBQAFc9nHJOw1 7izectOvyxL9dgNtPQ+QAajWdggTJtX5yCuNipmD7W5I70xSEEadUexesTt3Y88R7fIg IM57Hr5+OstJo3tUgUS3wfLNn7xcW6y94yWGHrbU8DG0NyiwPLxbLw2fYUpV4S2sGRPb Xg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3g8c9cg113-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 May 2022 14:45:03 +0000 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 24NEiGTo011957; Mon, 23 May 2022 14:45:02 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3g8c9cg0yw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 May 2022 14:45:02 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 24NEd64i004356; Mon, 23 May 2022 14:45:00 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma01fra.de.ibm.com with ESMTP id 3g6qq8ub1k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 May 2022 14:45:00 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 24NEiwNd38470142 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 23 May 2022 14:44:58 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 185FFA4060; Mon, 23 May 2022 14:44:58 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C1CB4A405C; Mon, 23 May 2022 14:44:57 +0000 (GMT) Received: from [9.152.222.246] (unknown [9.152.222.246]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 23 May 2022 14:44:57 +0000 (GMT) Message-ID: Date: Mon, 23 May 2022 16:44:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v2 net] net/smc: postpone sk_refcnt increment in connect() Content-Language: en-US To: liuyacan@corp.netease.com Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, ubraun@linux.ibm.com References: <5ce801b7-d446-ee28-86ec-968b7c172a80@linux.ibm.com> <20220523141905.2791310-1-liuyacan@corp.netease.com> From: Karsten Graul Organization: IBM Deutschland Research & Development GmbH In-Reply-To: <20220523141905.2791310-1-liuyacan@corp.netease.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: jmcfSzowpcL_SaOEd9NjJpJxo70dlrIL X-Proofpoint-ORIG-GUID: qpf_3J9lSgJDrxhBB6hmz2bMj0ObisEk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-23_06,2022-05-23_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 suspectscore=0 malwarescore=0 adultscore=0 phishscore=0 spamscore=0 priorityscore=1501 lowpriorityscore=0 impostorscore=0 clxscore=1015 mlxscore=0 mlxlogscore=651 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205230081 X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/05/2022 16:19, liuyacan@corp.netease.com wrote: >> 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()? What I had in mind was to eventually call sock_put() in __smc_release() even if sk->sk_state == SMC_INIT (currently the extra check in the if() for sk->sk_state != SMC_INIT prevents the sock_put()), but only when it is sure that we actually reached the sock_hold() in smc_connect() before. But maybe we find out that the sock_hold() is not needed for fallback sockets, I don't know...