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 2F0ED34CFD0 for ; Thu, 11 Jun 2026 04:35:53 +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=1781152555; cv=none; b=g2WSJxkHCJ41hIuD/JlB3k+gsLvck9arpql4aaDpe/buqKyAZqI9cAomPI38JbSObcnZ+FTty4Bour8aVG7MZpJML3yh9/yR9gF02Qc2+IPiLjuzDPhTxm367aeRa0rfQC/pUDQvfAQFOMQmrgW97EAORc0WCpPwz9pca7QEu8Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781152555; c=relaxed/simple; bh=RBtM2K5HAboXGskkkhCTAIlRz7iBBSjZG1WoOi7K0cE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bzkLU1n/gqqrP0pM6CCaWmRuvv2WggcggEGptTxpjJW/NK9IYcG8FjSXs0MyJyUo7MkiRZ2QS66OZ9qQqxWC//yErbD8nZVcwrv7FQpo4t3jvv38Nvi4IFvenYCSNq8m57Y99MMq+uxDJXYVekCcKRnpdZCMnAtd0Gpqybb64uE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jKw6Or8P; 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="jKw6Or8P" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85FB31F00893; Thu, 11 Jun 2026 04:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781152553; bh=RBtM2K5HAboXGskkkhCTAIlRz7iBBSjZG1WoOi7K0cE=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=jKw6Or8PUn8mM8QSyoHKukGjtNmlEqJLvHQXxCKMjvgSAlvbSPoDtHTLOYjUPSQMX NUGcsOnXvnSQEF/D4RZYRH72AtZFetepAJKnJFaN1FEZ7g7HCyUnLnMtcm6u9tXYPQ J2txDzG1CviQKZVz4dEtzlCb2+gdfMWMpgzsAVtrBe3kSoI0sc44MW4S+ABd2tYW2b W2HW+2LV+fu86k7mBZNf0HAtKphWM17UmDjwWB7Km+tLcDq2sBDTdF+hpHZE1+55C9 B4Q2y19JfLFCQfy9+KiN88LL7a4COOlpBWE8DaGGgb8+3iCH1aCWlZyZmF671FzsPS gmIH6I0Fm7TzQ== Message-ID: Date: Thu, 11 Jun 2026 13:35:46 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/5] mm/khugepaged: use slab cache instead of normal kmalloc To: Luka Bai , "Vlastimil Babka (SUSE)" Cc: linux-mm@kvack.org, Andrew Morton , David Hildenbrand , Lorenzo Stoakes , Zi Yan , Baolin Wang , "Liam R. Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Kairui Song , Qi Zheng , Shakeel Butt , Axel Rasmussen , Yuanchu Xie , Wei Xu , Rik van Riel , Jann Horn , Johannes Weiner , linux-kernel@vger.kernel.org, Luka Bai References: <20260531-thp_collapse_hint-v1-0-e7f8c2035621@tencent.com> <20260531-thp_collapse_hint-v1-2-e7f8c2035621@tencent.com> Content-Language: en-US From: Harry Yoo In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------s0FuOZXCRkHyas8wwz3tzD0p" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------s0FuOZXCRkHyas8wwz3tzD0p Content-Type: multipart/mixed; boundary="------------JMw89MqN6K3e0LGsnFwEl6z0"; protected-headers="v1" From: Harry Yoo To: Luka Bai , "Vlastimil Babka (SUSE)" Cc: linux-mm@kvack.org, Andrew Morton , David Hildenbrand , Lorenzo Stoakes , Zi Yan , Baolin Wang , "Liam R. Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Kairui Song , Qi Zheng , Shakeel Butt , Axel Rasmussen , Yuanchu Xie , Wei Xu , Rik van Riel , Jann Horn , Johannes Weiner , linux-kernel@vger.kernel.org, Luka Bai Message-ID: Subject: Re: [PATCH 2/5] mm/khugepaged: use slab cache instead of normal kmalloc References: <20260531-thp_collapse_hint-v1-0-e7f8c2035621@tencent.com> <20260531-thp_collapse_hint-v1-2-e7f8c2035621@tencent.com> In-Reply-To: --------------JMw89MqN6K3e0LGsnFwEl6z0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 6/11/26 12:16 PM, Luka Bai wrote: > =E5=9C=A8 Tue, Jun 09, 2026 at 12:26:18PM +0200=EF=BC=8CVlastimil Babka= (SUSE) =E5=86=99=E9=81=93=EF=BC=9A >> On 5/31/26 06:23, Luka Bai wrote: >>> From: Luka Bai >>> >>> We added a kmem slab cached called collapse_hint_cache for >>> khugepaged collapse hint, to improve the performance in allocation >>> and freeing for the hint structs. >>> >>> Signed-off-by: Luka Bai >> >> Khugepaged isn't exactly a hotpath? Adding own cache comes with memory= >> overhead, so this doesn't seem like a sufficient reason to do that. >> > Hi Vlastimil, >=20 > Thanks for the review :). >=20 > Yeah Khugepaged is not a hotpath. But in my implementation we will allo= cate > those khugepaged collapse hint structs in other paths like walk_mm() an= d > lru_gen_look_around(), which may be called more frequently under memory= > pressure. I'm a little afraid that directly using kmalloc may compromis= e > the performance of reclaimation... What do you think? Thanks. :) What makes you think using kmalloc compromises the performance under memory pressure? > Best regards, > Luka --=20 Cheers, Harry / Hyeonggon --------------JMw89MqN6K3e0LGsnFwEl6z0-- --------------s0FuOZXCRkHyas8wwz3tzD0p Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQQQ1ub6gR5ogjaKRmOGXBN6rc5S1gUCaio7IgAKCRCGXBN6rc5S 1iGEAQCcjg+KNn4s7QndYuB9qY/SnSuBzaTEp6GosQ8dG2oEhQD9Gf4bo4jevpE4 1qR5mrl3EDcwM1nWunUMATpFPfo4vwU= =7p8w -----END PGP SIGNATURE----- --------------s0FuOZXCRkHyas8wwz3tzD0p--