From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.189]) (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 EF5D027FB37 for ; Wed, 11 Feb 2026 13:42:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770817350; cv=none; b=FQauUD38pxY7sxPWumSkX4KsjOw0t8PA9aVoNU8/HsQZm73s+MC6WEMPomniAie5vXGMx+8EQ+NtklTpIT0EKlYYztitErLcXMLeUZWH/UCvX4GTeh5zJXVmNxmWOhCMnOwChp8Wk0uXhxB9quP2jxx6jhrBukB2FRhLVhEE7oo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770817350; c=relaxed/simple; bh=xPh/nvAA1Ng/eue+k97KdZ5iOUMNvGBxlYCjUDupU/k=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=LHmHaVuYr0H9cpF8l4NxfA12AtfZpKXORUzA+wTTfAabLrE7OCnvfidGyLPhlfC/oz47t/hSnnmbGI28b35mwQM1K4aFJEGS8+xLY87O2ermhEMoKU24j/PVr1yrrU2Tb9znzVD2z63MflcFKfJyKRgZoOvwvIOzsX5DqDi05tc= 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=PZLy2fAq; arc=none smtp.client-ip=91.218.175.189 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="PZLy2fAq" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1770817346; 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=R3Ctt+BiEBkUfTwW8vlPQdhY++dZ5Wjo7IuFQ8gmzwY=; b=PZLy2fAqbqesw3HRJoMeWdo09ZsfG4IbsZCabZm/x/dmHKuE07rUE875NaY0R0exilxmbe BR6sfse3m1uaie7xcnyAXn15a0XlBkSLUMhfhVcfwFmjR84hEotHsegk+XOQ/Td3L6dF8V 8P9hCFWIHnxE9kmcg2b+wvOTHHp5T0Y= Date: Wed, 11 Feb 2026 13:42:24 +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> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Usama Arif In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 11/02/2026 13:36, 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). > > I guess it might be reasonable to have because I am sure it will fail at some point and maybe provoke weird issues we didn't think of. In that case, having an indication that splitting failed at some point might be reasonable. > ack