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 81850DDAB for ; Sun, 11 Jan 2026 01:57:58 +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=1768096678; cv=none; b=b3duTCy25Gf3shbYEE2xnd9DrrBrubN0X5ddYPFYJ+xvgGtYQfcMD6vnSv/9hDiDIzdas7JpRY61BqR+0mpP/8KMbytcChH94LqdQjBAcAgCdRrfQ39YwvIsfXfqxtwhrAvHhQte43VsNsGPFZyxi2qzBFdVgHVlnjhsCxildRA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768096678; c=relaxed/simple; bh=3pG1EeZlLxet5aKNMRFDKjVbAb6NYPuPBzdlG9priJ4=; h=Date:To:From:Subject:Message-Id; b=ncDWCQt3OBPL341Jo/UMT7DuQETEUktzwghZwl7OV3or8F7mSjzjTzB26I0SDmdA3IaoD9o0d1omlTXAxbbMDnW7VJZ5lXvIr0JmeuEMHfWM4GviXecH7Pb6ncxra7gAXJOMjw2sC8DvlMm2xzcWA34b30ILYBJnZvZsOD+2pz8= 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=DtGuSfYL; 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="DtGuSfYL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18C64C4CEF1; Sun, 11 Jan 2026 01:57:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1768096678; bh=3pG1EeZlLxet5aKNMRFDKjVbAb6NYPuPBzdlG9priJ4=; h=Date:To:From:Subject:From; b=DtGuSfYLj/nj2AdwkDBmOhYWzmzn6h2VounhlSErCijgVhDWFxfvMUIoszwIwcNsP 7hDJgGdB3vAxVSQ2m/LoRzGGIJr39tfNCPgGf+aqRam1yY4S6/iKpRVwseEyAm8At4 DNICxGlUbJDFNP7eLuTAHH/mqhlfF+z4Oi2j5kvM= Date: Sat, 10 Jan 2026 17:57:57 -0800 To: mm-commits@vger.kernel.org,ziy@nvidia.com,willy@infradead.org,vbabka@suse.cz,sidhartha.kumar@oracle.com,osalvador@suse.de,muchun.song@linux.dev,jane.chu@oracle.com,jackmanb@google.com,hannes@cmpxchg.org,david@redhat.com,claudiu.beznea.uj@bp.renesas.com,broonie@kernel.org,wangkefeng.wang@huawei.com,akpm@linux-foundation.org From: Andrew Morton Subject: + mm-page_alloc-add-__split_page.patch added to mm-new branch Message-Id: <20260111015758.18C64C4CEF1@smtp.kernel.org> Precedence: bulk X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: The patch titled Subject: mm: page_alloc: add __split_page() has been added to the -mm mm-new branch. Its filename is mm-page_alloc-add-__split_page.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-page_alloc-add-__split_page.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. The mm-new branch of mm.git is not included in linux-next 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 various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: Kefeng Wang Subject: mm: page_alloc: add __split_page() Date: Fri, 9 Jan 2026 17:31:32 +0800 Factor out the splitting of non-compound page from make_alloc_exact() and split_page() into a new helper function __split_page(). While at it, convert the VM_BUG_ON_PAGE() into a VM_WARN_ON_PAGE(). Link: https://lkml.kernel.org/r/20260109093136.1491549-3-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Acked-by: David Hildenbrand Acked-by: Muchun Song Reviewed-by: Zi Yan Reviewed-by: Sidhartha Kumar Cc: Brendan Jackman Cc: Jane Chu Cc: Johannes Weiner Cc: Matthew Wilcox (Oracle) Cc: Oscar Salvador Cc: Vlastimil Babka Cc: Claudiu Beznea Cc: Mark Brown Signed-off-by: Andrew Morton --- include/linux/mmdebug.h | 10 ++++++++++ mm/page_alloc.c | 21 +++++++++++++-------- 2 files changed, 23 insertions(+), 8 deletions(-) --- a/include/linux/mmdebug.h~mm-page_alloc-add-__split_page +++ a/include/linux/mmdebug.h @@ -47,6 +47,15 @@ void vma_iter_dump_tree(const struct vma BUG(); \ } \ } while (0) +#define VM_WARN_ON_PAGE(cond, page) ({ \ + int __ret_warn = !!(cond); \ + \ + if (unlikely(__ret_warn)) { \ + dump_page(page, "VM_WARN_ON_PAGE(" __stringify(cond)")");\ + WARN_ON(1); \ + } \ + unlikely(__ret_warn); \ +}) #define VM_WARN_ON_ONCE_PAGE(cond, page) ({ \ static bool __section(".data..once") __warned; \ int __ret_warn_once = !!(cond); \ @@ -122,6 +131,7 @@ void vma_iter_dump_tree(const struct vma #define VM_BUG_ON_MM(cond, mm) VM_BUG_ON(cond) #define VM_WARN_ON(cond) BUILD_BUG_ON_INVALID(cond) #define VM_WARN_ON_ONCE(cond) BUILD_BUG_ON_INVALID(cond) +#define VM_WARN_ON_PAGE(cond, page) BUILD_BUG_ON_INVALID(cond) #define VM_WARN_ON_ONCE_PAGE(cond, page) BUILD_BUG_ON_INVALID(cond) #define VM_WARN_ON_FOLIO(cond, folio) BUILD_BUG_ON_INVALID(cond) #define VM_WARN_ON_ONCE_FOLIO(cond, folio) BUILD_BUG_ON_INVALID(cond) --- a/mm/page_alloc.c~mm-page_alloc-add-__split_page +++ a/mm/page_alloc.c @@ -3110,6 +3110,15 @@ void free_unref_folios(struct folio_batc folio_batch_reinit(folios); } +static void __split_page(struct page *page, unsigned int order) +{ + VM_WARN_ON_PAGE(PageCompound(page), page); + + split_page_owner(page, order, 0); + pgalloc_tag_split(page_folio(page), order, 0); + split_page_memcg(page, order); +} + /* * split_page takes a non-compound higher-order page, and splits it into * n (1<