All of lore.kernel.org
 help / color / mirror / Atom feed
* [to-be-updated] mm-khugepaged-sched-to-numa-node-when-collapse-huge-page.patch removed from -mm tree
@ 2022-05-13  0:36 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2022-05-13  0:36 UTC (permalink / raw)
  To: mm-commits, shy828301, mike.kravetz, david, maobibo, akpm


The quilt patch titled
     Subject: mm/khugepaged: sched to numa node when collapse huge page
has been removed from the -mm tree.  Its filename was
     mm-khugepaged-sched-to-numa-node-when-collapse-huge-page.patch

This patch was dropped because an updated version will be merged

------------------------------------------------------
From: Bibo Mao <maobibo@loongson.cn>
Subject: mm/khugepaged: sched to numa node when collapse huge page

Collapsing a huge page will copy huge page from general small pages, dest
node is calculated from most one of source pages, however THP daemon is
not scheduled on dest node.  The performance may be poor since huge page
copying across nodes, also cache is not used for target node.  With this
patch, khugepaged daemon switches to the same numa node with huge page. 
It saves copying time and makes use of local cache better.

With this patch, specint 2006 base performance is improved with 6% on
Loongson 3C5000L platform with 32 cores and 8 numa nodes.

Link: https://lkml.kernel.org/r/20220317065024.2635069-1-maobibo@loongson.cn
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Cc: David Hildenbrand <david@redhat.com>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/khugepaged.c |    8 ++++++++
 1 file changed, 8 insertions(+)

--- a/mm/khugepaged.c~mm-khugepaged-sched-to-numa-node-when-collapse-huge-page
+++ a/mm/khugepaged.c
@@ -1055,6 +1055,7 @@ static void collapse_huge_page(struct mm
 	struct vm_area_struct *vma;
 	struct mmu_notifier_range range;
 	gfp_t gfp;
+	const struct cpumask *cpumask;
 
 	VM_BUG_ON(address & ~HPAGE_PMD_MASK);
 
@@ -1068,6 +1069,13 @@ static void collapse_huge_page(struct mm
 	 * that. We will recheck the vma after taking it again in write mode.
 	 */
 	mmap_read_unlock(mm);
+
+	/* sched to specified node before huage page memory copy */
+	if (task_node(current) != node) {
+		cpumask = cpumask_of_node(node);
+		if (!cpumask_empty(cpumask))
+			set_cpus_allowed_ptr(current, cpumask);
+	}
 	new_page = khugepaged_alloc_page(hpage, gfp, node);
 	if (!new_page) {
 		result = SCAN_ALLOC_HUGE_PAGE_FAIL;
_

Patches currently in -mm which might be from maobibo@loongson.cn are



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

only message in thread, other threads:[~2022-05-13  0:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13  0:36 [to-be-updated] mm-khugepaged-sched-to-numa-node-when-collapse-huge-page.patch removed from -mm tree Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.