🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #7491

Re: [PATCH net-next 1/3] net: qrtr: do not take the sock lock on blocking recv

#7491
From: Manivannan Sadhasivam
Date: Mon, 26 Oct 2026 12:53
23 lines
8929 bytes
On Fri, Oct 16, 2026 at 01:58:18AM -0700, Chunkai Deng wrote:
> qrtr_recvmsg() takes lock_sock() before skb_recv_datagram() and keeps it
> while waiting for a datagram. Any other call on the same socket, such as
> sendmsg(), bind() or ioctl(), blocks until a packet arrives.
> 
> Take the lock only once a datagram has been dequeued. The receive queue
> has its own lock and the enqueue path never takes the socket lock. The
> lock is still needed around the copy and skb_free_datagram(), since
> TIOCINQ peeks the queue under lock_sock() only.
> 
> Testing SOCK_ZAPPED without the lock means a recv() racing with bind()
> may return -EADDRNOTAVAIL for a port that was just published. There is
> no ordering between the two calls anyway.
> 
> Signed-off-by: Chunkai Deng <chunkai.deng@oss.qualcomm.com>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>

- Mani

-- 
மணிவண்ணன் சதாசிவம்
Technical Details
Message-ID: <at9NMmRJSZhiT3yg@debian>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351902-linux-kernel-netdev=dewy.ru
References: <20261016-qrtr-add-shutdown-v1-0-e1cc01ca5919@oss.qualcomm.com> <20261016-qrtr-add-shutdown-v1-1-e1cc01ca5919@oss.qualcomm.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-351902-linux-kernel-netdev=dewy.ru
From: mani@kernel.org (Manivannan Sadhasivam)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 1/3] net: qrtr: do not take the sock lock on
 blocking recv
Date: Mon, 26 Oct 2026 18:23:14 +0530
Organization: Usenet Network
Message-ID: <at9NMmRJSZhiT3yg@debian>
References: <20261016-qrtr-add-shutdown-v1-0-e1cc01ca5919@oss.qualcomm.com>
 <20261016-qrtr-add-shutdown-v1-1-e1cc01ca5919@oss.qualcomm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1307521"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:qeAXI0a2+Dni257/FFZkY5IoU/8= sha256:NTrfdNGMXAyS4MrxW/U69H31xwAUoBTOR7q33N4kdwg=
	sha1:nh4fmcNx/wKn/81SfCPbGYBuQCs= sha256:mZT3tmsdTmMzlvIFVN6lAy18OWEvmJl6Quf12ldkGiM=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 17CCC125BA7; Mon, 26 Oct 2026 15:53:55 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.839
X-Spam-Status: No, score=-3.839 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.339, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id rLDqP1q0suwh;
	Mon, 26 Oct 2026 15:53:52 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-351902-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 0EAD0125BA6; Mon, 26 Oct 2026 15:53:43 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 8B773601DFD; Mon, 26 Oct 2026 12:53:42 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793019221;
	b=NFk1YkMqXWW1MMwVDhFg+T6UBBA2lp+4ftnBksSBIGZBvSF1oaaCRHBBl1T2/tiCckhs
	 IGTovTQA4doDRmoCl57D0UrU9qVUweYZqqrwKxdp3fdHyJgmzuiXT4dlr+dC7dOeKxgvh
	 0iUCOsca5PvwcC1s/47j5mhm9a0ayCZ/1P8PPpCgYbBXxltG+ZdZofEP/mPJC/9deGO59
	 HuVMsgc0OESIGmvePytqV1gNaZ9JBlblWbomj5mE8X4tm9lAmZXv/2fTNyq+LrLPTbPSf
	 Q52ym+lqlvhu55jRmgtX218uu7FWF8PxWPqWpgCpEmOwRf1ogrAWuTH3COu7X2SXAPA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793019221;
	h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc:
	 Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Type:Content-Disposition:
	 Content-Transfer-Encoding:In-Reply-To;
	bh=wNAm+QK6fuK2feImJ+iyd7AbEuB0Qapzr4gOqGefZxg=;
	b=B8qU85nmuC9N2KuQ4ctjSjMhzoJweLHSbZ1jcnbDu2TWFMFcZuo0y/5pkOs6BnMeI0As
	 fLxvzXX65VYlq5X1zkUW8mX9L7mj3ZtbTuJFGZitYRDGQK1kxBOiRCB6fgFEiTry3sshZ
	 fQVWn7Lh0pH87Fo/uj6ivIMf9bh8ijgw5oja1zOHvODoFL2YXQ1W97WYqtdJ4EzS74bCA
	 Jjf0w3vwzi7vdBfxv5VYW8Dgatr+cAPAPDqyIZqCnO88zVvIFimDUs4uZHHKwLMpSmed2
	 G/cIicfW7xrnjbnR/Z56LEr2ChfZPbPn51fRu0lWUXF7ZmqQ9yucVOYEdBKOkzsXPaQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GGha7X4x;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 53B94606A31F;
	Mon, 26 Oct 2026 12:53:41 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GGha7X4x
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793019205;
	b=a+PRNi9EaCrLYPwEv2LDljUUEJTY/NIGCWsTFU44amhT/VLb94nHYynKl5Hb3Oqal6ad
	 hrWiGmMpEnwk72+rM2KH+Dyro+wYK0XZME7dd8DsZ/ewZyJzEnAVxDRmCY6pKNJjDtTX3
	 TXpUAV3PG77XGLkbXGYbbf5Y7+W21s8MFOJWppQ+HIDv9q7XLpOiiiddB0wIabILNRwV+
	 9Ril99MldjHaJJGHt9dJi4i6WxtnAAKIQ8RuuWwcI7GokCE+KXE3JACSOfQeMboZnW9dA
	 yCo8VArYXvlcdL+E4Z/UgiB6Tq7xuh/wDr6XdGeY4bcRqfUbIfwH0EKFt/KICBHEMwQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793019205;
	h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:
	 Content-Transfer-Encoding:In-Reply-To;
	bh=wNAm+QK6fuK2feImJ+iyd7AbEuB0Qapzr4gOqGefZxg=;
	b=d4IADDhXW5yqfUBSqNvlxO7/tpg0FNu2SED5xo4y7asJLac5MwFm81ps/xYNuHKKLf1c
	 gJdbi9eHBA4oDF+5ZAlDTZPSBIM73DvVJv9bDmA1mA8em2ptQgOMB05h2O5qQcUB4G16f
	 BLgb9veydzfeAT/BNWQapsJxW5mmj2DSKp/2uyB5atOxmaLxN4aKXhGzhBb8H6oRdXZiR
	 4LRq0wz17mGdfkYGxZ3WiVclqHY5eSswQllBCAgc99RlZYot4Ls6urZ8dbEj/Qoknme+q
	 VQB5p9lwEqRVDBinkcb0nufa8zsjE36/8YsOUcLsRN419foX2hd6IEHzHqpPPJF+Whg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=GGha7X4x;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 324F6606A31B;
	Mon, 26 Oct 2026 12:53:24 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id E49611F01828;
	Mon, 26 Oct 2026 12:53:19 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1793019204;
	bh=wNAm+QK6fuK2feImJ+iyd7AbEuB0Qapzr4gOqGefZxg=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=GGha7X4xi3MROzPTAp/gn97EFZNPWFVLEnLQDa5yWCac3ywERdPK2pd9YaQG7pViL
	 DMnrWeth++TYI+qeTsAJr0RCbaX6Qx4eRkNOTVjpsG/X1JCu+c1YeBSSXTIMmMx5Dh
	 zwmr3UWC004jDEroEZWgnauPfvYD7IBoSIK27dWZvm/OdDau3VxeV+Ixi1YGCkNN8O
	 lib9228tn3GRqimPsXIpbt2VlAVcy40xKurzOzeX3OKPqbQWp8jsHg4ZXsOdQ09e9u
	 I9umW3dhG8ElDOJf3BUIzVB1iHlPvvv2UFeU+8BKpgzMYgLRHiKoSrpf7efImvZEeS
	 y/QSkt8BTIEhQ==
X-Cc: "David S. Miller" <davem@davemloft.net>, 
	Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, 
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, linux-arm-msm@vger.kernel.org, 
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org, tao.zhang1@oss.qualcomm.com, 
	peter.chen@oss.qualcomm.com, jeff.johnson@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261016-qrtr-add-shutdown-v1-1-e1cc01ca5919@oss.qualcomm.com>