From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 CD261382370; Sun, 5 Jul 2026 14:19:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783261168; cv=none; b=cUbgdI2DtKgIGZIJIyay/BPD7l6NBUInDchuoRNVnMowlN3Exk/EK1tAUAnmCAJzeLlMaOT64/PHgLpa5x1OyzKn+O2nLDghajoMsEnfLuNbH+nZzeoAU3lYgbBoeExSBwstKMAcuG8fmAqy/9TogJLBKzFRnM8f5dYknX48kcc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783261168; c=relaxed/simple; bh=jcPJen87JmcP/j7nnSpXSY1c7GTdyigGtyopvSguuN4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=m9qoDtCQ/0N6W8zwkB0xfY+zTSf6XXvnlS+TUnTyXCxbHs7K3H3dJ5IA84Vwaemre6dxZR4bhJatugOVZhXahAbvGGo43697yLg7KxZNzWhJ4T8mp++Q1qZxr8MeCLUhcfO4qfsrsEgCGIyoH+328exeIecq4jSDdXs3lpdgDJw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cptocLBo; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cptocLBo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 857331F000E9; Sun, 5 Jul 2026 14:19:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783261167; bh=9DrplwkjJBjGxh1cD2R/mrFbb4Rpl+IeLJikyWbz1n0=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=cptocLBoWZfJf1xHYKJoahvZWPj09dm3x9FLqDXE3okKXJfVcomzfi4Mb8GMT+0rZ eC8ShOS3TECSZQc2yeSvxIEUCQ5/Zg5n/l7A0PMRmE8g1Vo7VoAP9XD6iAtKVJytPB Komnun2kImCh88/6eIfp0I75KS/xzkxKHxwBdPpmUdVJrlLjLFA69N581eiP4QaghD Xy/9b8exL1sLmFALl9CqOmja/fTBqR/qPJGUxscaZ+pLoFyNa+IwwlovyQij64QD/W 4ldZcyf90JsGEkKU6wSciZH4/WrDFUzGNRr7unp3oVr5ByekNOa5NGCtv4djSbgYx+ r7rUEhGxftVZQ== Date: Sun, 5 Jul 2026 17:19:20 +0300 From: Leon Romanovsky To: Zhiping Zhang Cc: saeedm@nvidia.com, tariqt@nvidia.com, mbloch@nvidia.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, michaelgur@nvidia.com, stable@vger.kernel.org Subject: Re: [PATCH net v2] net/mlx5: free mlx5_st_idx_data on final dealloc Message-ID: <20260705141920.GI15188@unreal> References: <20260630165324.2859353-1-zhipingz@meta.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260630165324.2859353-1-zhipingz@meta.com> On Tue, Jun 30, 2026 at 09:53:20AM -0700, Zhiping Zhang wrote: > Workloads that repeatedly allocate and release mkeys carrying TPH > steering-tag hints (e.g. churning RDMA MRs) leak one > struct mlx5_st_idx_data per cycle; kmemleak flags it as unreferenced > and the kmalloc slab grows over time. > > When the last reference to an ST table entry is dropped, > mlx5_st_dealloc_index() removed the entry from idx_xa but the backing > mlx5_st_idx_data allocation was never freed. > > Free idx_data after the xa_erase() so the lifetime of the bookkeeping > struct matches the lifetime of the ST entry it tracks. > > Cc: stable@vger.kernel.org > Fixes: 888a7776f4fb ("net/mlx5: Add support for device steering tag") > Reviewed-by: Michael Gur > Signed-off-by: Zhiping Zhang > --- > v2: respin per maintainer-netdev.rst; no code change. > v1: https://lore.kernel.org/linux-rdma/20260612170406.3339093-1-zhipingz@meta.com/ > > drivers/net/ethernet/mellanox/mlx5/core/lib/st.c | 1 + > 1 file changed, 1 insertion(+) > Thanks, Reviewed-by: Leon Romanovsky