Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2871126rdb; Wed, 15 Nov 2023 13:06:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFUtkwQEH8IGLJpGy2wSQVRcjnILramLNCENUaVSgH+58Qme4R55kCVvO1TV2M4UlJgsJft X-Received: by 2002:a05:620a:1a1b:b0:767:261d:1ef6 with SMTP id bk27-20020a05620a1a1b00b00767261d1ef6mr7655470qkb.59.1700082391031; Wed, 15 Nov 2023 13:06:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700082391; cv=none; d=google.com; s=arc-20160816; b=b8Q6UflQ740zcMr3BksVc/XCDT+2HOJ48QUcmpJUzPFr2GOibSRZoPoiGfkyRJw2fa 0bApr1zdFtAY2E/Y4q1OnX/HFMJQDINyEKweAAui2dRFi6kW2eSSrP/awfvwE3UqH5lx NOqMxW2N4Xdpr9Kf5oBzLKfIXm8nVucejIzFdgOEO8nitzSDSOOiVbvtSvw4CZy4KL8r W1x/9bJt8ZZYFll12YyV7YFpudj/p/ZlMgOolp8MDxQrm80NXup3BLXKgf43D9SlelCy yxCElMfwnZ/nan6DDjRIVMzfDSBF1yHgQ2PuJDIIvMaRpxvawpZ2rjmUeBit9IXFSJeB bdpw== 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=M/2ZyYZIlXaVrQ5H2NVMzh6RQkIaOQLrSYQoOoe/xlo=; fh=hbopeTiG/AFpDYL0DqTnP5D2crtv3xbSEUvuPydpCdQ=; b=Jjs9rG056d98uAm05sbvOPi++hXOM3+uQ8/6zaCXi+uhlX/WA+UBLjlFpZXAedE42P IveEl1w+nUu9GsaALNPvyFPSm3/SBiKEP5v4YmuwvPiiswU8Ozm4fGf4iRnyItrENj7V AB+i0UGx3SQRMkgxcrhd/MKmaug9bhY4D/AbTQkhhOg/ctYK55PhRxr8ghRZSw5dfMeX tAoSKYaRAxzAEi3z0tMoQw2QEYydEav6SApK+xd0FoyjB0chwJfD4h/mzqmyHj6/0E3E Q5doMjSeWDbLRY9EVWya9zoZXc3DxpfLSwCZuQk1IQF2F1/jSVFK6C2XIWZxkjGyxVSU CqVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=e5qKkSsg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id pr1-20020a05620a86c100b0076dbbc2aaf9si10556601qkn.179.2023.11.15.13.06.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 13:06:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=e5qKkSsg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 9F60980A438C; Wed, 15 Nov 2023 13:06:24 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344970AbjKOVFx (ORCPT + 99 others); Wed, 15 Nov 2023 16:05:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235590AbjKOVFc (ORCPT ); Wed, 15 Nov 2023 16:05:32 -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 6C0A7D79 for ; Wed, 15 Nov 2023 13:05:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700082321; 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=M/2ZyYZIlXaVrQ5H2NVMzh6RQkIaOQLrSYQoOoe/xlo=; b=e5qKkSsg9UPttgvJWNlHnxsiFQvTIXhfSWAlI7jMLZGSvknVVWyl03ZrYBhlQ2X7x1HDYa VxyK6mE8IHUYepSkV985Yunl0ApjximVksM0ZjwVPCUv0PgSw+nvderRdXfvR+4d8tgWOh Z/uYSTNyMYfZtkRG3WiTFOMQMdFDreA= 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-250-JizxYATBPXy1AFjmuMswsQ-1; Wed, 15 Nov 2023 16:05:20 -0500 X-MC-Unique: JizxYATBPXy1AFjmuMswsQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (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 AC3D585A58B; Wed, 15 Nov 2023 21:05:19 +0000 (UTC) Received: from vschneid-thinkpadt14sgen2i.remote.csb (unknown [10.22.34.128]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 604403D6; Wed, 15 Nov 2023 21:05:19 +0000 (UTC) From: Valentin Schneider To: dccp@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , David Ahern , Juri Lelli , Tomas Glozar , Sebastian Andrzej Siewior , Thomas Gleixner Subject: [PATCH v2 2/2] tcp/dcpp: Don't disable bh around timewait_sock initialization Date: Wed, 15 Nov 2023 16:05:09 -0500 Message-ID: <20231115210509.481514-3-vschneid@redhat.com> In-Reply-To: <20231115210509.481514-1-vschneid@redhat.com> References: <20231115210509.481514-1-vschneid@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 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 fry.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 (fry.vger.email [0.0.0.0]); Wed, 15 Nov 2023 13:06:25 -0800 (PST) Now that the tw_timer is armed *after* the hashdance, it is the last step of the timewait initialization. We can thus enable softirqs without running the risk of the timer handler running before the initialization is done. This is conceptually a revert of cfac7f836a71 ("tcp/dccp: block bh before arming time_wait timer") Signed-off-by: Valentin Schneider --- net/dccp/minisocks.c | 4 ---- net/ipv4/tcp_minisocks.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/net/dccp/minisocks.c b/net/dccp/minisocks.c index 2f0fad4255e36..cb990bc92a5c9 100644 --- a/net/dccp/minisocks.c +++ b/net/dccp/minisocks.c @@ -53,15 +53,11 @@ void dccp_time_wait(struct sock *sk, int state, int timeo) if (state == DCCP_TIME_WAIT) timeo = DCCP_TIMEWAIT_LEN; - local_bh_disable(); - // Linkage updates inet_twsk_hashdance(tw, sk, &dccp_hashinfo); inet_twsk_schedule(tw, timeo); // Access to tw after this point is illegal. inet_twsk_put(tw); - - local_bh_enable(); } else { /* Sorry, if we're out of memory, just CLOSE this * socket up. We've got bigger problems than diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 48eb0310fe837..c7d46674d55cb 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -338,15 +338,11 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) if (state == TCP_TIME_WAIT) timeo = TCP_TIMEWAIT_LEN; - local_bh_disable(); - // Linkage updates. inet_twsk_hashdance(tw, sk, net->ipv4.tcp_death_row.hashinfo); inet_twsk_schedule(tw, timeo); // Access to tw after this point is illegal. inet_twsk_put(tw); - - local_bh_enable(); } else { /* Sorry, if we're out of memory, just CLOSE this * socket up. We've got bigger problems than -- 2.41.0