From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-177.mta0.migadu.com (out-177.mta0.migadu.com [91.218.175.177]) (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 D8CFF28CF5D for ; Wed, 11 Feb 2026 13:43:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770817436; cv=none; b=dSEKnKsatGhN75HqaTC8gZZF3B3Du3w6LAEJJWX+acdJlaEqvX996eR6uSBZQAhtDbdbb9TR9e4msi2cHJ+dbzFsZ0XDLCIlHslmNlKnPSObk15UVPMfn9cIL5rbHiqpsB4a3z97+Ahw0CeX58VUSz3UuAhBs4Erh+am4xkIW00= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770817436; c=relaxed/simple; bh=2QQvYex8WJfpyqrUv4iXBgHmKDpsKG2TbSettmOaJd8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Ha83EumXesA6k40byidvju00LjWatLupXGcmDhORqdi/PaiRWPYDPbMJcgpnYl6CqU2L0uNWpYAQDXb4Nj56Y8uHsWHdi2orm17Hc8bkNW8BO5Kc1FkabknZR4H0tcQAQk6sur3iSVzZ21kQKqr9avTexJb9A851gMjPk4itFZY= 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=R0XyRy93; arc=none smtp.client-ip=91.218.175.177 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="R0XyRy93" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1770817432; 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=6KLG8bhLyjMsETJH5YfhYwScAEgCa0JqyUBbwWjyXRg=; b=R0XyRy93PG9P6ztb9vsQVoBS6kKy/UyrpL6qjba4sBBp5CFvGNouIpkSnL357KckPm0VBB tlPYqT5LTLL+2f+uk+kI75+SlHd0nbI5uupX+yuYB1HT7c/vZ39KG3iY5aoEbl0mPA40Vr gEn8sSEcKcernfBHMKFoky8ZxkmYq3o= Date: Wed, 11 Feb 2026 13:43:50 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [RFC 2/2] mm: thp: add THP_SPLIT_PMD_PTE_ALLOC_FAILED counter Content-Language: en-GB To: "David Hildenbrand (Arm)" , Andrew Morton , lorenzo.stoakes@oracle.com, willy@infradead.org, linux-mm@kvack.org Cc: fvdl@google.com, hannes@cmpxchg.org, riel@surriel.com, shakeel.butt@linux.dev, kas@kernel.org, baohua@kernel.org, dev.jain@arm.com, baolin.wang@linux.alibaba.com, npache@redhat.com, Liam.Howlett@oracle.com, ryan.roberts@arm.com, vbabka@suse.cz, lance.yang@linux.dev, linux-kernel@vger.kernel.org, kernel-team@meta.com References: <20260211125507.4175026-1-usama.arif@linux.dev> <20260211125507.4175026-3-usama.arif@linux.dev> <7790f69d-7406-4535-994b-8f4b240269ba@linux.dev> <918b5c70-1245-437b-857f-0b202f5bb400@kernel.org> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Usama Arif In-Reply-To: <918b5c70-1245-437b-857f-0b202f5bb400@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 11/02/2026 13:38, David Hildenbrand (Arm) wrote: > On 2/11/26 14:31, Usama Arif wrote: >> >> >> On 11/02/2026 13:27, David Hildenbrand (Arm) wrote: >>> On 2/11/26 13:49, Usama Arif wrote: >>>> Add a vmstat counter to track PTE allocation failures during PMD split. >>>> This enables monitoring of split failures due to memory pressure after >>>> the lazy PTE page table allocation change. >>>> >>>> The counter is incremented in three places: >>>> - __split_huge_pmd(): Main entry point for splitting a PMD >>>> - try_to_unmap_one(): When reclaim needs to split a PMD-mapped THP >>>> - try_to_migrate_one(): When migration needs to split a PMD-mapped THP >>>> >>>> Visible via /proc/vmstat as thp_split_pmd_pte_alloc_failed. >>>> >>>> Signed-off-by: Usama Arif >>>> --- >>>>    include/linux/vm_event_item.h | 1 + >>>>    mm/huge_memory.c              | 1 + >>>>    mm/rmap.c                     | 3 +++ >>>>    mm/vmstat.c                   | 1 + >>>>    4 files changed, 6 insertions(+) >>>> >>>> diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h >>>> index 22a139f82d75f..827c9a8c251de 100644 >>>> --- a/include/linux/vm_event_item.h >>>> +++ b/include/linux/vm_event_item.h >>>> @@ -111,6 +111,7 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, >>>>            THP_DEFERRED_SPLIT_PAGE, >>>>            THP_UNDERUSED_SPLIT_PAGE, >>>>            THP_SPLIT_PMD, >>>> +        THP_SPLIT_PMD_PTE_ALLOC_FAILED, >>> >>> Probably sufficient to call this THP_SPLIT_PMD_FAILED and count any (future) failures (if any) as well. >>> >> >> Makes sense. This was just a patch I was using for testing and I wanted to share. >> It was always 0 as I couldnt get split to fail :) But I can rename it as THP_SPLIT_PMD_FAILED >> as suggested and we can use for future split failures (hopefully none). > > Btw, you can use the allocation fault injection framework to find weird issues, if you haven't heard of that yet. > This looks very interesting, Thanks! Let me have a look.