+ mm-mincore-replace-__get_free_page-with-kmalloc.patch added to mm-new branch
Andrew Morton <[email protected]>
| Newsgroups | org.kernel.vger.mm-commits |
|---|---|
| Message-ID | <[email protected]> |
The patch titled
Subject: mm: mincore: replace __get_free_page() with kmalloc()
has been added to the -mm mm-new branch. Its filename is
mm-mincore-replace-__get_free_page-with-kmalloc.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-mincore-replace-__get_free_page-with-kmalloc.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
If a few days of testing in mm-new is successful, the patch will me moved
into mm.git's mm-unstable branch, which is 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 <[email protected]>
Subject: mm: mincore: replace __get_free_page() with kmalloc()
Date: Fri, 17 Jul 2026 17:13:44 +0800
Remove ugly casts by using the more natural kmalloc/kfree allocation, also
replace GFP_USER(pointless here) with GFP_KERNEL.
Link: https://lore.kernel.org/[email protected]
Signed-off-by: Kefeng Wang <[email protected]>
Reviewed-by: Pedro Falcato <[email protected]>
Acked-by: David Hildenbrand (Arm) <[email protected]>
Cc: Jann Horn <[email protected]>
Cc: Liam R. Howlett <[email protected]>
Cc: Lorenzo Stoakes <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Zi Yan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---
mm/mincore.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/mm/mincore.c~mm-mincore-replace-__get_free_page-with-kmalloc
+++ a/mm/mincore.c
@@ -12,6 +12,7 @@
#include <linux/gfp.h>
#include <linux/pagewalk.h>
#include <linux/mman.h>
+#include <linux/slab.h>
#include <linux/syscalls.h>
#include <linux/swap.h>
#include <linux/leafops.h>
@@ -329,7 +330,7 @@ SYSCALL_DEFINE3(mincore, unsigned long,
if (!access_ok(vec, pages))
return -EFAULT;
- tmp = (void *) __get_free_page(GFP_USER);
+ tmp = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!tmp)
return -EAGAIN;
@@ -354,6 +355,6 @@ SYSCALL_DEFINE3(mincore, unsigned long,
start += retval << PAGE_SHIFT;
retval = 0;
}
- free_page((unsigned long) tmp);
+ kfree(tmp);
return retval;
}
_
Patches currently in -mm which might be from [email protected] are
mm-migrate_device-fix-pte_pfn-pte_dirty-called-on-non-present-pte.patch
mm-remove-pagetranscompound.patch
mm-mincore-use-walk_page_range_vma-in-do_mincore.patch
mm-mprotect-use-walk_page_range_vma-in-mprotect_fixup.patch
mm-mlock-use-walk_page_range_vma-in-mlock_vma_pages_range.patch
mm-migrate_device-use-walk_page_range_vma-in-migrate_vma_collect.patch
mm-introduce-pud_is_huge-helper.patch
mm-mincore-remove-special-handling-for-vm_pfnmap.patch
mm-mincore-replace-__get_free_page-with-kmalloc.patch
mm-mincore-remove-xa_is_value-in-mincore_swap.patch
mm-mincore-improve-mincore_hugetlb.patch
mm-mincore-refactor-mincore_page.patch