From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (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 20638340273 for ; Tue, 3 Mar 2026 07:55:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772524538; cv=none; b=CdnXd0Lnb4eFqbDu4j4pUqCj4KYs4saeoTi6b9X7SJhKlpfrxMVTUBFg0ujmXkJCOQBgMEXZmKvtSFNlLfM7zl7fTUAw7rwsWXS12Ry/jkYFlw7kTmYvP3mYS0vfyEshkMHUON+s2Fv8HcFk2k4T6JsCDuj29whPBPG9IYPkfjo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772524538; c=relaxed/simple; bh=w6kLN9l16em167id7+XiLiiASwbQTBDLSgzxoVs13GE=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=bctIGo6c6X+zA4koSiuoA7Yr+mPkiHF9XzLgDErkXchYijRpVEJQ+nMGGOslWCzCtGUBimJlZ0mgccHwvWoGk7YNs4FyalAWzpt7WRdrFYOHyfUKe1iLMf6iRUacnI3H7d7ihDF4ol+7T6aSG/xA7leVoFhOI+3g0grhKHoGN/8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=efTva1fZ; arc=none smtp.client-ip=95.215.58.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="efTva1fZ" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1772524524; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bxG9CBSKXqMOaX3Bqq09GBqHI5tqsiwgqZYokMmDM48=; b=efTva1fZ6QGsh+dwZLtRd470YngV5PSD6btzU8G3iGgirf758luOfMxD3fmP4T5xQXbQuM e18/8rsGbD23Yt+JEeW8juFd17Fv4wVFBRTkUcG2VMgett51Zqeo3BfJauHsDLEjHQEqe1 SH70VH3CNpv5cWF8qZMspU+FrGdmhE8= Date: Tue, 3 Mar 2026 15:55:13 +0800 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [RFC PATCH net-next] tcp: Add net.ipv4.tcp_purge_receive_queue sysctl Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Leon Hwang To: Eric Dumazet Cc: Jakub Kicinski , Leon Hwang , netdev@vger.kernel.org, "David S . Miller" , Paolo Abeni , Simon Horman , Jonathan Corbet , Shuah Khan , David Ahern , Neal Cardwell , Kuniyuki Iwashima , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , Ido Schimmel , kerneljasonxing@gmail.com, lance.yang@linux.dev, jiayuan.chen@linux.dev, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260225074633.149590-1-leon.huangfu@shopee.com> <20260225174354.5a698ddb@kernel.org> <20260302162251.733b520e@kernel.org> <3a623176-fc5f-4dd4-bbfc-64d211f53645@linux.dev> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 3/3/26 14:26, Leon Hwang wrote: > > > On 3/3/26 11:55, Eric Dumazet wrote: >> On Tue, Mar 3, 2026 at 3:12 AM Leon Hwang wrote: >>> >>> >>> >>> On 3/3/26 08:22, Jakub Kicinski wrote: >>>> On Mon, 2 Mar 2026 17:55:59 +0800 Leon Hwang wrote: >>>>> On 26/2/26 09:43, Jakub Kicinski wrote: >>>>>> On Wed, 25 Feb 2026 15:46:33 +0800 Leon Hwang wrote: >>>>>>> Issue: >>>>>>> When a TCP socket in the CLOSE_WAIT state receives a RST packet, the >>>>>>> current implementation does not clear the socket's receive queue. This >>>>>>> causes SKBs in the queue to remain allocated until the socket is >>>>>>> explicitly closed by the application. As a consequence: >>>>>>> >>>>>>> 1. The page pool pages held by these SKBs are not released. >>>>>> >>>>>> On what kernel version and driver are you observing this? >>>>> >>>>> # uname -r >>>>> 6.19.0-061900-generic >>>>> >>>>> # ethtool -i eth0 >>>>> driver: mlx5_core >>>>> version: 6.19.0-061900-generic >>>>> firmware-version: 26.43.2566 (MT_0000000531) >>>> >>>> Okay... this kernel + driver should just patiently wait for the page >>>> pool to go away. >>>> >>>> What is the actual, end user problem that you're trying to solve? >>>> A few kB of data waiting to be freed is not a huge problem.. >>> >>> Yes, it is not a huge problem. >>> >>> The actual end-user issue was discussed in >>> "page_pool: Add page_pool_release_stalled tracepoint" [1]. >>> >>> I think it would be useful to provide a way for SREs to purge the >>> receive queue when CLOSE_WAIT TCP sockets receive RST packets. If the >>> NIC, e.g., Mellanox, flaps, the underlying page pool and pages can be >>> released at the same time. >>> >>> Links: >>> [1] >>> https://lore.kernel.org/netdev/b676baa0-2044-4a74-900d-f471620f2896@linux.dev/ >> >> Perhaps SRE could use this in an emergency? >> >> ss -t -a state close-wait -K > > This ss command is acceptable in an emergency. > However, once a CLOSE_WAIT TCP socket receives an RST packet, it transitions to the CLOSE state. A socket in the CLOSE state cannot be killed using the ss approach. The SKBs remain in the receive queue of the CLOSE socket until it is closed by the user-space application. Thanks, Leon