From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AE9BF283121 for ; Thu, 27 Nov 2025 20:27:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764275269; cv=none; b=Dltm9lunDss3V4ZHWsTXSkeNHDOjQFRn2tCyRwVQgt9MjvWTFySRs97+JHLC6AC7042u8tm3kAYZHW1KfQVMjsAc3oAxjSoaNHfqsXznnBJsbDg6W0ufE5MHKPymM74seGZpHj+FG0LbE+1dw+xZ//HNO0ufm0PaEnEefE0C8tw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764275269; c=relaxed/simple; bh=x5Ey1afDdKQdYGnk28Q9q7nb//0tvt27AoS0B/Cszz4=; h=Date:To:From:Subject:Message-Id; b=r6RONHAohy8rqtg4s6vUINxvHG1AQSmRuaXsD1R0wMw5W79kYe/lMxtWeQd8Rafygbv83fHK+E3WvaxCaECxad8p6met5WMGQ7Xi+5GW9iWOiy1fdducxxDlQhlLJA2u/vYo0tSAFlrkXbtqzXP5ynaE0lDslobRc6yWiKbCfTU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=dVCfkBd9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="dVCfkBd9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47361C4CEF8; Thu, 27 Nov 2025 20:27:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1764275268; bh=x5Ey1afDdKQdYGnk28Q9q7nb//0tvt27AoS0B/Cszz4=; h=Date:To:From:Subject:From; b=dVCfkBd9y7Guq5zhLQ9ZUwgxPYD+wAqET4Kv/JPPkgexfp1gClmStex2eb/sr1zex /U1LW5xA7UYC1z96/ATWNWzU4UZjerJNczQJyKX03FhglTUZ846gLXUMRsfG6pZstp AGQJNJx3LxpXdNr+5+TEgZdR5WS0UlPZ/aM6dfy4= Date: Thu, 27 Nov 2025 12:27:47 -0800 To: mm-commits@vger.kernel.org,ryan.roberts@arm.com,richard.weiyang@gmail.com,npache@redhat.com,nao.horiguchi@gmail.com,lorenzo.stoakes@oracle.com,linmiaohe@huawei.com,liam.howlett@oracle.com,lance.yang@linux.dev,dev.jain@arm.com,david@kernel.org,baolin.wang@linux.alibaba.com,baohua@kernel.org,balbirs@nvidia.com,ziy@nvidia.com,akpm@linux-foundation.org From: Andrew Morton Subject: + mm-huge_memory-fix-folio-split-stats-counting.patch added to mm-new branch Message-Id: <20251127202748.47361C4CEF8@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: mm/huge_memory: fix folio split stats counting has been added to the -mm mm-new branch. Its filename is mm-huge_memory-fix-folio-split-stats-counting.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-huge_memory-fix-folio-split-stats-counting.patch This patch will later appear in the mm-new branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Note, mm-new is a provisional staging ground for work-in-progress patches, and acceptance into mm-new is a notification for others take notice and to finish up reviews. Please do not hesitate to respond to review feedback and post updated versions to replace or incrementally fixup patches in mm-new. Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Zi Yan Subject: mm/huge_memory: fix folio split stats counting Date: Tue, 25 Nov 2025 22:50:08 -0500 The "return " statements for error checks at the beginning of __folio_split() skip necessary count_vm_event() and count_mthp_stat() at the end of the function. Fix these by replacing them with "ret = ; goto out;". Link: https://lkml.kernel.org/r/20251126035008.1919461-5-ziy@nvidia.com Signed-off-by: Zi Yan Reviewed-by: Wei Yang Reviewed-by: Lorenzo Stoakes Acked-by: David Hildenbrand (Red Hat) Cc: Balbir Singh Cc: Baolin Wang Cc: Barry Song Cc: Dev Jain Cc: Lance Yang Cc: Liam Howlett Cc: Miaohe Lin Cc: Naoya Horiguchi Cc: Nico Pache Cc: Ryan Roberts Signed-off-by: Andrew Morton --- mm/huge_memory.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) --- a/mm/huge_memory.c~mm-huge_memory-fix-folio-split-stats-counting +++ a/mm/huge_memory.c @@ -3944,16 +3944,20 @@ static int __folio_split(struct folio *f VM_WARN_ON_ONCE_FOLIO(!folio_test_locked(folio), folio); VM_WARN_ON_ONCE_FOLIO(!folio_test_large(folio), folio); - if (folio != page_folio(split_at) || folio != page_folio(lock_at)) - return -EINVAL; + if (folio != page_folio(split_at) || folio != page_folio(lock_at)) { + ret = -EINVAL; + goto out; + } - if (new_order >= old_order) - return -EINVAL; + if (new_order >= old_order) { + ret = -EINVAL; + goto out; + } ret = folio_check_splittable(folio, new_order, split_type); if (ret) { VM_WARN_ONCE(ret == -EINVAL, "Tried to split an unsplittable folio"); - return ret; + goto out; } if (is_anon) { _ Patches currently in -mm which might be from ziy@nvidia.com are mm-huge_memory-change-folio_split_supported-to-folio_check_splittable.patch mm-huge_memory-replace-can_split_folio-with-direct-refcount-calculation.patch mm-huge_memory-make-min_order_for_split-always-return-an-order.patch mm-huge_memory-fix-folio-split-stats-counting.patch