From patchwork Tue Jun 4 14:08:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Westphal X-Patchwork-Id: 13685393 X-Patchwork-Delegate: kuba@kernel.org Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [91.216.245.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C916584055 for ; Tue, 4 Jun 2024 14:11:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.216.245.30 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717510301; cv=none; b=j5E8JUYKTVc96KP3I248tvNoeqMCzy/Nx7GIj6pAHjxzF0SqQZztbQNPUJ7/lbEM06MJDWTNqEd6opBcNWOfZGB9S+EX4OxKyYPbKGEoyfuu01QFOcPXlG1jFTFeVvbbXMWBob3UznUW63Ti4XIqvmHvi3JnmjiBwVSXcVeaUvc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717510301; c=relaxed/simple; bh=O8zCPgUf2OG/q4RG+mMzSgXzSLqYSMND9IPGvCwxRE0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pQdsV1kMFX6I5F9xIuP2l/EToOOvHrLhLwgBpdWu1mF9C1LAqWwMyyokqcxnhy5AjgC+lBj5rMD5yE1f/FYYql39JeeUG3eqhxn1hRkKrspvhKHydEPW4F5A+oEkCbjuJi0WflDEAP29iqVhoeglWyPSPBFH7EdZtJAaFM+nd7g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de; spf=pass smtp.mailfrom=breakpoint.cc; arc=none smtp.client-ip=91.216.245.30 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=breakpoint.cc Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1sEUsx-0002Hm-Sm; Tue, 04 Jun 2024 16:11:35 +0200 From: Florian Westphal To: netdev@vger.kernel.org Cc: Paolo Abeni , "David S. Miller" , Eric Dumazet , Jakub Kicinski , vschneid@redhat.com, tglozar@redhat.com, bigeasy@linutronix.de, Florian Westphal Subject: [PATCH net-next v7 2/3] net: tcp: un-pin the tw_timer Date: Tue, 4 Jun 2024 16:08:48 +0200 Message-ID: <20240604140903.31939-3-fw@strlen.de> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240604140903.31939-1-fw@strlen.de> References: <20240604140903.31939-1-fw@strlen.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org After previous patch, even if timer fires immediately on another CPU, context that schedules the timer now holds the ehash spinlock, so timer cannot reap tw socket until ehash lock is released. Signed-off-by: Florian Westphal Reviewed-by: Eric Dumazet --- no changes. net/ipv4/inet_timewait_sock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/inet_timewait_sock.c b/net/ipv4/inet_timewait_sock.c index 628d33a41ce5..3e89b927ee61 100644 --- a/net/ipv4/inet_timewait_sock.c +++ b/net/ipv4/inet_timewait_sock.c @@ -203,7 +203,7 @@ struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, tw->tw_prot = sk->sk_prot_creator; atomic64_set(&tw->tw_cookie, atomic64_read(&sk->sk_cookie)); twsk_net_set(tw, sock_net(sk)); - timer_setup(&tw->tw_timer, tw_timer_handler, TIMER_PINNED); + timer_setup(&tw->tw_timer, tw_timer_handler, 0); /* * Because we use RCU lookups, we should not set tw_refcnt * to a non null value before everything is setup for this