From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from outbound.qs.icloud.com (qs-2003a-snip4-7.eps.apple.com [57.103.86.10]) (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 1979B3B28D for ; Thu, 11 Jun 2026 03:16:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=57.103.86.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781147794; cv=none; b=qg+jYtfP9d7YwM9gmtLkHOP0Nrhczf3N5Uiu9fXXl4lOFl1LPDLKNd2KEyxWybTpPIkNce57Bi1RWa0Bwe0VJ1ze0neFbF/k5fRFvObEwEJh/gPiq4LjbzMlQ5ogifqQ0qcE2DlCycXHi9RJJWWWlb6GASqXg3rjIzZCWAhsqGY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781147794; c=relaxed/simple; bh=wEkgxkH5OIL2CavL/BRpCmCLpo5+VX2kcwebj80SKFE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=e4BjVIwucBqkZlVq5z5TOjiDdpDW7wEPM//VdeDv6d1m8QxCKdFhjW1HfzHQbothm3uLP+VVLGKeN13tWYGCS3C++gREF0x1+h51denq3yVU6H1I0LVi9Yw+4GdUdIe+8SReMu9CQ0amM5km/b0uEMEE7rD1EZzW4gD45FW9hpI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com; spf=pass smtp.mailfrom=icloud.com; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b=wOctC8bb; arc=none smtp.client-ip=57.103.86.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=icloud.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b="wOctC8bb" Received: from outbound.qs.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-east-2d-100-percent-10 (Postfix) with ESMTPS id 9639818000B0; Thu, 11 Jun 2026 03:16:29 +0000 (UTC) X-ICL-Out-Info: HUtFAUMEWwJACUgBTUQeDx5WFlZNRAJCTQ1LHVwEWRxBDUkdXwdLVxQEFEYGVg1dE0wLcwRUB10FXVZQAlpLVBQEEVABWB5WXloXXk1FCA9CAVhbCFsEDx9MDFECQgVWXkgLHQRUB10FXVZQAlpLQgRLRWhcBVwcQBdIHV9qS1YUBBFQAVgeVl5aF15NWgJWTQUZWgJYAnwJdzwBPA5dUERTOH84fCpwMXBVfi4GVRIEQAhWUF4IXh9MHA== Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; t=1781147792; x=1783739792; bh=cx5WsLzy5EMop1LAYacetf6b3lNRD+oGL1mjgLaY/us=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:x-icloud-hme; b=wOctC8bbl2IalnPoB+hZO6LmlxEnlUSui8CDAdSCXG6pAX/0JVEUWP4J7UM8Ihob1LcA91MJamQXIqIBd9Z7HNBqLK5Gk7g8A4G8FDH7QoGsqJUTRTJ2y7gtaoxEDTX/i4oLNSb1wg6GrzyLUG0tH3pE3KzEGCf4TzeE8mTho8W6mduv8M2uxEwOcXhwqeHbZfotwHfDtVB3z+FeUgW0TtpK9e/Enr7WPCNCiyRIaNXZEmekW3yqdikaFHXK9z3ipTwdcU/gixmOFQrkXTThWhKOMV1eT8oWv9GEJ0/Qqar/PNUfaosnGIyfbESHpjzUjX1zwo/iS/R/UquyV3r9iA== Received: from localhost (unknown [17.57.155.37]) by p00-icloudmta-asmtp-us-east-2d-100-percent-10 (Postfix) with ESMTPSA id A2EA1180058C; Thu, 11 Jun 2026 03:16:28 +0000 (UTC) Date: Thu, 11 Jun 2026 11:16:24 +0800 From: Luka Bai To: "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 , Harry Yoo , Jann Horn , Johannes Weiner , linux-kernel@vger.kernel.org, Luka Bai Subject: Re: [PATCH 2/5] mm/khugepaged: use slab cache instead of normal kmalloc Message-ID: References: <20260531-thp_collapse_hint-v1-0-e7f8c2035621@tencent.com> <20260531-thp_collapse_hint-v1-2-e7f8c2035621@tencent.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Proofpoint-ORIG-GUID: t5BKz75ZnySRwTvBBiKMnByvzccKJ5w6 X-Authority-Info-Out: v=2.4 cv=EKwLElZC c=1 sm=1 tr=0 ts=6a2a288f cx=c_apl:c_pps:t_out a=bsP7O+dXZ5uKcj+dsLqiMw==:117 a=bsP7O+dXZ5uKcj+dsLqiMw==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=x7bEGLp0ZPQA:10 a=UaoJkeuwEpQA:10 a=VkNPw1HP01LnGYTKEx00:22 a=GvQkQWPkAAAA:8 a=m7Ui_3NsPc4YXKPq_aYA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjExMDAyOSBTYWx0ZWRfX4l+a9oFbl2ox b88Qc2+ZGmKn++3zFz882O+a9KPxBFQ3YHYIW46q+0JhG5h8r6Cx4c4h+SI6IZZdxv/+q3g+SeO wv2x6YY9/NY2v+vQqPborxdmenjriyGjiocUi5Zxr+9TwwASzEM7VZ9S+MCiELPuXRgG+jESZQN TEDibLodPu3OcTE3eXqkm6g948PJrjS+LD3Hzmv8alpc+qN86XQjW8Q1qAbP5PlE/p2W1O+dV0P Qf+zUZsMtD0GuzpQmoaOMsE3ljscNkv3IVl7TdUeIAZXee/MG+iQmxktBk3EjGPjS0gA44vmOhv hr7Qmd04d43M164WJ89sTL0Mlg6bFR9IuYBxsdwsySpR/Qiheq2RvXwxkAA1Ww= X-Proofpoint-GUID: t5BKz75ZnySRwTvBBiKMnByvzccKJ5w6 在 Tue, Jun 09, 2026 at 12:26:18PM +0200,Vlastimil Babka (SUSE) 写道: > 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, Thanks for the review :). Yeah Khugepaged is not a hotpath. But in my implementation we will allocate those khugepaged collapse hint structs in other paths like walk_mm() and lru_gen_look_around(), which may be called more frequently under memory pressure. I'm a little afraid that directly using kmalloc may compromise the performance of reclaimation... What do you think? Thanks. :) Best regards, Luka