From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) (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 9580D27A465; Fri, 12 Sep 2025 09:40:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757670061; cv=none; b=hYqwYP2XWD5x4oPil2bCBnd5/GTh+ZEP7ttBJu5udbtQNvnNFaE8enLaVTJlC24p0cyxsps6rBnNzJQcDQCigvxbQbTtUHrS0jfIb/jOc3sD7X9nsaD319NIcOshJuZJj4K4B1yrWTTssJ+JO1NJY8j8G/MApZfYVPDOFQSNlvY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757670061; c=relaxed/simple; bh=lJ36e+t/tg8LmpoQ6endDbrNr7eRgy5K+DROEoJYN0s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=sUl9gPGtqqknMPzwYLARIV3SsOKXgZwcxHYRmvg43RlRD1AF5aPWmB6Ge4d2D1LHz+IeSOt0atGAHv/GCQwRiIChUxEi9h9COXpDEpQ32VIm1s6PGeHH6RAQbxs6uOozo79gOz4CljYEceCgtsfHfvQ496Flmry/sb0REMP1aGY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=Xt6HyY9g; arc=none smtp.client-ip=115.124.30.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="Xt6HyY9g" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1757670055; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=8wqlXppzbfyIOcS8BfKoIJCpvoAzpjciPU1+yNHw35A=; b=Xt6HyY9gswY87UdAPCE6BA83evTUJGamPqQrffh1bPmucYESaMAp1YO7dpWY00k08ZipzcHOZeuS348ILcdMcFfFbzGeW4liQnegRPvzQ447HhLpix+iwk/K3fVXjRCFPk1UiCKuyR+wjMFAGAPjH7TB7VSKp4uCZxpL66KbBoo= Received: from 30.74.144.122(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0WnqpLMs_1757669731 cluster:ay36) by smtp.aliyun-inc.com; Fri, 12 Sep 2025 17:35:32 +0800 Message-ID: <068a41eb-3a5c-4749-a8f6-c1bda1fb6a4b@linux.alibaba.com> Date: Fri, 12 Sep 2025 17:35:31 +0800 Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v11 09/15] khugepaged: add per-order mTHP collapse failure statistics To: Nico Pache , linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Cc: david@redhat.com, ziy@nvidia.com, lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, ryan.roberts@arm.com, dev.jain@arm.com, corbet@lwn.net, rostedt@goodmis.org, mhiramat@kernel.org, mathieu.desnoyers@efficios.com, akpm@linux-foundation.org, baohua@kernel.org, willy@infradead.org, peterx@redhat.com, wangkefeng.wang@huawei.com, usamaarif642@gmail.com, sunnanyong@huawei.com, vishal.moola@gmail.com, thomas.hellstrom@linux.intel.com, yang@os.amperecomputing.com, kas@kernel.org, aarcange@redhat.com, raquini@redhat.com, anshuman.khandual@arm.com, catalin.marinas@arm.com, tiwai@suse.de, will@kernel.org, dave.hansen@linux.intel.com, jack@suse.cz, cl@gentwo.org, jglisse@google.com, surenb@google.com, zokeefe@google.com, hannes@cmpxchg.org, rientjes@google.com, mhocko@suse.com, rdunlap@infradead.org, hughd@google.com, richard.weiyang@gmail.com, lance.yang@linux.dev, vbabka@suse.cz, rppt@kernel.org, jannh@google.com, pfalcato@suse.de References: <20250912032810.197475-1-npache@redhat.com> <20250912032810.197475-10-npache@redhat.com> From: Baolin Wang In-Reply-To: <20250912032810.197475-10-npache@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2025/9/12 11:28, Nico Pache wrote: > Add three new mTHP statistics to track collapse failures for different > orders when encountering swap PTEs, excessive none PTEs, and shared PTEs: > > - collapse_exceed_swap_pte: Increment when mTHP collapse fails due to swap > PTEs > > - collapse_exceed_none_pte: Counts when mTHP collapse fails due to > exceeding the none PTE threshold for the given order > > - collapse_exceed_shared_pte: Counts when mTHP collapse fails due to shared > PTEs > > These statistics complement the existing THP_SCAN_EXCEED_* events by > providing per-order granularity for mTHP collapse attempts. The stats are > exposed via sysfs under > `/sys/kernel/mm/transparent_hugepage/hugepages-*/stats/` for each > supported hugepage size. > > As we currently dont support collapsing mTHPs that contain a swap or > shared entry, those statistics keep track of how often we are > encountering failed mTHP collapses due to these restrictions. > > Signed-off-by: Nico Pache > --- LGTM. Reviewed-by: Baolin Wang