Linux MM tree latest commits
 help / color / mirror / Atom feed
* [merged mm-stable] mm-mincore-replace-__get_free_page-with-kmalloc.patch removed from -mm tree
@ 2026-08-07  2:01 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-08-07  2:01 UTC (permalink / raw)
  To: mm-commits, ziy, vbabka, pfalcato, ljs, liam, jannh, david,
	wangkefeng.wang, akpm


The quilt patch titled
     Subject: mm: mincore: replace __get_free_page() with kmalloc()
has been removed from the -mm tree.  Its filename was
     mm-mincore-replace-__get_free_page-with-kmalloc.patch

This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Kefeng Wang <wangkefeng.wang@huawei.com>
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/20260717091347.1144789-4-wangkefeng.wang@huawei.com
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: Pedro Falcato <pfalcato@suse.de>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 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>
@@ -328,7 +329,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;
 
@@ -353,6 +354,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 wangkefeng.wang@huawei.com are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-07  2:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07  2:01 [merged mm-stable] mm-mincore-replace-__get_free_page-with-kmalloc.patch removed from -mm tree Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox