linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -mm 0/3] fix numa vs kvm scalability issue
@ 2014-02-18 22:12 riel
  2014-02-18 22:12 ` [PATCH -mm 1/3] sched,numa: add cond_resched to task_numa_work riel
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: riel @ 2014-02-18 22:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: kvm, linux-mm, peterz, chegu_vinod, aarcange, akpm

The NUMA scanning code can end up iterating over many gigabytes
of unpopulated memory, especially in the case of a freshly started
KVM guest with lots of memory.

This results in the mmu notifier code being called even when
there are no mapped pages in a virtual address range. The amount
of time wasted can be enough to trigger soft lockup warnings
with very large (>2TB) KVM guests.

This patch moves the mmu notifier call to the pmd level, which
represents 1GB areas of memory on x86-64. Furthermore, the mmu
notifier code is only called from the address in the PMD where
present mappings are first encountered.

The hugetlbfs code is left alone for now; hugetlb mappings are
not relocatable, and as such are left alone by the NUMA code,
and should never trigger this problem to begin with.

The series also adds a cond_resched to task_numa_work, to
fix another potential latency issue.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH -mm 1/3] sched,numa: add cond_resched to task_numa_work
  2014-02-18 22:12 [PATCH -mm 0/3] fix numa vs kvm scalability issue riel
@ 2014-02-18 22:12 ` riel
  2014-02-18 22:12 ` [PATCH -mm 2/3] mm,numa: reorganize change_pmd_range riel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: riel @ 2014-02-18 22:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: kvm, linux-mm, peterz, chegu_vinod, aarcange, akpm

From: Rik van Riel <riel@redhat.com>

Normally task_numa_work scans over a fairly small amount of memory,
but it is possible to run into a large unpopulated part of virtual
memory, with no pages mapped. In that case, task_numa_work can run
for a while, and it may make sense to reschedule as required.

Signed-off-by: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Reported-by: Xing Gang <gang.xing@hp.com>
Tested-by: Chegu Vinod <chegu_vinod@hp.com>
---
 kernel/sched/fair.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 966cc2b..7815709 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1757,6 +1757,8 @@ void task_numa_work(struct callback_head *work)
 			start = end;
 			if (pages <= 0)
 				goto out;
+
+			cond_resched();
 		} while (end != vma->vm_end);
 	}
 
-- 
1.8.5.3

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH -mm 2/3] mm,numa: reorganize change_pmd_range
  2014-02-18 22:12 [PATCH -mm 0/3] fix numa vs kvm scalability issue riel
  2014-02-18 22:12 ` [PATCH -mm 1/3] sched,numa: add cond_resched to task_numa_work riel
@ 2014-02-18 22:12 ` riel
  2014-02-19  2:22   ` David Rientjes
  2014-02-18 22:12 ` [PATCH -mm 3/3] move mmu notifier call from change_protection to change_pmd_range riel
  2014-02-19  8:59 ` [PATCH -mm 0/3] fix numa vs kvm scalability issue Peter Zijlstra
  3 siblings, 1 reply; 10+ messages in thread
From: riel @ 2014-02-18 22:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: kvm, linux-mm, peterz, chegu_vinod, aarcange, akpm

From: Rik van Riel <riel@redhat.com>

Reorganize the order of ifs in change_pmd_range a little, in
preparation for the next patch.

Signed-off-by: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Reported-by: Xing Gang <gang.xing@hp.com>
Tested-by: Chegu Vinod <chegu_vinod@hp.com>
---
 mm/mprotect.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/mm/mprotect.c b/mm/mprotect.c
index 769a67a..6006c05 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -118,6 +118,8 @@ static inline unsigned long change_pmd_range(struct vm_area_struct *vma,
 		unsigned long this_pages;
 
 		next = pmd_addr_end(addr, end);
+		if (!pmd_trans_huge(*pmd) && pmd_none_or_clear_bad(pmd))
+				continue;
 		if (pmd_trans_huge(*pmd)) {
 			if (next - addr != HPAGE_PMD_SIZE)
 				split_huge_page_pmd(vma, addr, pmd);
@@ -133,10 +135,9 @@ static inline unsigned long change_pmd_range(struct vm_area_struct *vma,
 					continue;
 				}
 			}
-			/* fall through */
+			/* fall through, the trans huge pmd just split */
 		}
-		if (pmd_none_or_clear_bad(pmd))
-			continue;
+		VM_BUG_ON(pmd_trans_huge(*pmd));
 		this_pages = change_pte_range(vma, pmd, addr, next, newprot,
 				 dirty_accountable, prot_numa);
 		pages += this_pages;
-- 
1.8.5.3

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH -mm 3/3] move mmu notifier call from change_protection to change_pmd_range
  2014-02-18 22:12 [PATCH -mm 0/3] fix numa vs kvm scalability issue riel
  2014-02-18 22:12 ` [PATCH -mm 1/3] sched,numa: add cond_resched to task_numa_work riel
  2014-02-18 22:12 ` [PATCH -mm 2/3] mm,numa: reorganize change_pmd_range riel
@ 2014-02-18 22:12 ` riel
  2014-02-19  2:24   ` David Rientjes
  2014-02-19  8:59 ` [PATCH -mm 0/3] fix numa vs kvm scalability issue Peter Zijlstra
  3 siblings, 1 reply; 10+ messages in thread
From: riel @ 2014-02-18 22:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: kvm, linux-mm, peterz, chegu_vinod, aarcange, akpm

From: Rik van Riel <riel@redhat.com>

The NUMA scanning code can end up iterating over many gigabytes
of unpopulated memory, especially in the case of a freshly started
KVM guest with lots of memory.

This results in the mmu notifier code being called even when
there are no mapped pages in a virtual address range. The amount
of time wasted can be enough to trigger soft lockup warnings
with very large KVM guests.

This patch moves the mmu notifier call to the pmd level, which
represents 1GB areas of memory on x86-64. Furthermore, the mmu
notifier code is only called from the address in the PMD where
present mappings are first encountered.

The hugetlbfs code is left alone for now; hugetlb mappings are
not relocatable, and as such are left alone by the NUMA code,
and should never trigger this problem to begin with.

Signed-off-by: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Reported-by: Xing Gang <gang.xing@hp.com>
Tested-by: Chegu Vinod <chegu_vinod@hp.com>
---
 mm/mprotect.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/mm/mprotect.c b/mm/mprotect.c
index 6006c05..44850ee 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -109,9 +109,11 @@ static inline unsigned long change_pmd_range(struct vm_area_struct *vma,
 		pgprot_t newprot, int dirty_accountable, int prot_numa)
 {
 	pmd_t *pmd;
+	struct mm_struct *mm = vma->vm_mm;
 	unsigned long next;
 	unsigned long pages = 0;
 	unsigned long nr_huge_updates = 0;
+	unsigned long mni_start = 0;
 
 	pmd = pmd_offset(pud, addr);
 	do {
@@ -120,6 +122,13 @@ static inline unsigned long change_pmd_range(struct vm_area_struct *vma,
 		next = pmd_addr_end(addr, end);
 		if (!pmd_trans_huge(*pmd) && pmd_none_or_clear_bad(pmd))
 				continue;
+
+		/* invoke the mmu notifier if the pmd is populated */
+		if (!mni_start) {
+			mni_start = addr;
+			mmu_notifier_invalidate_range_start(mm, mni_start, end);
+		}
+
 		if (pmd_trans_huge(*pmd)) {
 			if (next - addr != HPAGE_PMD_SIZE)
 				split_huge_page_pmd(vma, addr, pmd);
@@ -143,6 +152,9 @@ static inline unsigned long change_pmd_range(struct vm_area_struct *vma,
 		pages += this_pages;
 	} while (pmd++, addr = next, addr != end);
 
+	if (mni_start)
+		mmu_notifier_invalidate_range_end(mm, mni_start, end);
+
 	if (nr_huge_updates)
 		count_vm_numa_events(NUMA_HUGE_PTE_UPDATES, nr_huge_updates);
 	return pages;
@@ -205,12 +217,12 @@ unsigned long change_protection(struct vm_area_struct *vma, unsigned long start,
 	struct mm_struct *mm = vma->vm_mm;
 	unsigned long pages;
 
-	mmu_notifier_invalidate_range_start(mm, start, end);
-	if (is_vm_hugetlb_page(vma))
+	if (is_vm_hugetlb_page(vma)) {
+		mmu_notifier_invalidate_range_start(mm, start, end);
 		pages = hugetlb_change_protection(vma, start, end, newprot);
-	else
+		mmu_notifier_invalidate_range_end(mm, start, end);
+	} else
 		pages = change_protection_range(vma, start, end, newprot, dirty_accountable, prot_numa);
-	mmu_notifier_invalidate_range_end(mm, start, end);
 
 	return pages;
 }
-- 
1.8.5.3

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH -mm 2/3] mm,numa: reorganize change_pmd_range
  2014-02-18 22:12 ` [PATCH -mm 2/3] mm,numa: reorganize change_pmd_range riel
@ 2014-02-19  2:22   ` David Rientjes
  0 siblings, 0 replies; 10+ messages in thread
From: David Rientjes @ 2014-02-19  2:22 UTC (permalink / raw)
  To: riel; +Cc: linux-kernel, kvm, linux-mm, peterz, chegu_vinod, aarcange, akpm

On Tue, 18 Feb 2014, riel@redhat.com wrote:

> From: Rik van Riel <riel@redhat.com>
> 
> Reorganize the order of ifs in change_pmd_range a little, in
> preparation for the next patch.
> 
> Signed-off-by: Rik van Riel <riel@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
> Reported-by: Xing Gang <gang.xing@hp.com>
> Tested-by: Chegu Vinod <chegu_vinod@hp.com>

Acked-by: David Rientjes <rientjes@google.com>

> ---
>  mm/mprotect.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/mprotect.c b/mm/mprotect.c
> index 769a67a..6006c05 100644
> --- a/mm/mprotect.c
> +++ b/mm/mprotect.c
> @@ -118,6 +118,8 @@ static inline unsigned long change_pmd_range(struct vm_area_struct *vma,
>  		unsigned long this_pages;
>  
>  		next = pmd_addr_end(addr, end);
> +		if (!pmd_trans_huge(*pmd) && pmd_none_or_clear_bad(pmd))
> +				continue;
>  		if (pmd_trans_huge(*pmd)) {
>  			if (next - addr != HPAGE_PMD_SIZE)
>  				split_huge_page_pmd(vma, addr, pmd);

Extra tab there, though.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH -mm 3/3] move mmu notifier call from change_protection to change_pmd_range
  2014-02-18 22:12 ` [PATCH -mm 3/3] move mmu notifier call from change_protection to change_pmd_range riel
@ 2014-02-19  2:24   ` David Rientjes
  2014-02-19  3:08     ` Rik van Riel
  2014-02-19  3:18     ` [PATCH -mm v2 " Rik van Riel
  0 siblings, 2 replies; 10+ messages in thread
From: David Rientjes @ 2014-02-19  2:24 UTC (permalink / raw)
  To: riel; +Cc: linux-kernel, kvm, linux-mm, peterz, chegu_vinod, aarcange, akpm

On Tue, 18 Feb 2014, riel@redhat.com wrote:

> From: Rik van Riel <riel@redhat.com>
> 
> The NUMA scanning code can end up iterating over many gigabytes
> of unpopulated memory, especially in the case of a freshly started
> KVM guest with lots of memory.
> 
> This results in the mmu notifier code being called even when
> there are no mapped pages in a virtual address range. The amount
> of time wasted can be enough to trigger soft lockup warnings
> with very large KVM guests.
> 
> This patch moves the mmu notifier call to the pmd level, which
> represents 1GB areas of memory on x86-64. Furthermore, the mmu
> notifier code is only called from the address in the PMD where
> present mappings are first encountered.
> 
> The hugetlbfs code is left alone for now; hugetlb mappings are
> not relocatable, and as such are left alone by the NUMA code,
> and should never trigger this problem to begin with.
> 
> Signed-off-by: Rik van Riel <riel@redhat.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Andrea Arcangeli <aarcange@redhat.com>
> Reported-by: Xing Gang <gang.xing@hp.com>
> Tested-by: Chegu Vinod <chegu_vinod@hp.com>

Acked-by: David Rientjes <rientjes@google.com>

Might have been cleaner to move the 
mmu_notifier_invalidate_range_{start,end}() to hugetlb_change_protection() 
as well, though.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH -mm 3/3] move mmu notifier call from change_protection to change_pmd_range
  2014-02-19  2:24   ` David Rientjes
@ 2014-02-19  3:08     ` Rik van Riel
  2014-02-19  3:18     ` [PATCH -mm v2 " Rik van Riel
  1 sibling, 0 replies; 10+ messages in thread
From: Rik van Riel @ 2014-02-19  3:08 UTC (permalink / raw)
  To: David Rientjes
  Cc: linux-kernel, kvm, linux-mm, peterz, chegu_vinod, aarcange, akpm

On 02/18/2014 09:24 PM, David Rientjes wrote:
> On Tue, 18 Feb 2014, riel@redhat.com wrote:
> 
>> From: Rik van Riel <riel@redhat.com>
>>
>> The NUMA scanning code can end up iterating over many gigabytes
>> of unpopulated memory, especially in the case of a freshly started
>> KVM guest with lots of memory.
>>
>> This results in the mmu notifier code being called even when
>> there are no mapped pages in a virtual address range. The amount
>> of time wasted can be enough to trigger soft lockup warnings
>> with very large KVM guests.
>>
>> This patch moves the mmu notifier call to the pmd level, which
>> represents 1GB areas of memory on x86-64. Furthermore, the mmu
>> notifier code is only called from the address in the PMD where
>> present mappings are first encountered.
>>
>> The hugetlbfs code is left alone for now; hugetlb mappings are
>> not relocatable, and as such are left alone by the NUMA code,
>> and should never trigger this problem to begin with.
>>
>> Signed-off-by: Rik van Riel <riel@redhat.com>
>> Cc: Peter Zijlstra <peterz@infradead.org>
>> Cc: Andrea Arcangeli <aarcange@redhat.com>
>> Reported-by: Xing Gang <gang.xing@hp.com>
>> Tested-by: Chegu Vinod <chegu_vinod@hp.com>
> 
> Acked-by: David Rientjes <rientjes@google.com>
> 
> Might have been cleaner to move the 
> mmu_notifier_invalidate_range_{start,end}() to hugetlb_change_protection() 
> as well, though.

I can certainly do that if you want.  Just let me know
and I'll send a v2 of patch 3 :)

-- 
All rights reversed

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH -mm v2 3/3] move mmu notifier call from change_protection to change_pmd_range
  2014-02-19  2:24   ` David Rientjes
  2014-02-19  3:08     ` Rik van Riel
@ 2014-02-19  3:18     ` Rik van Riel
  1 sibling, 0 replies; 10+ messages in thread
From: Rik van Riel @ 2014-02-19  3:18 UTC (permalink / raw)
  To: David Rientjes
  Cc: linux-kernel, kvm, linux-mm, peterz, chegu_vinod, aarcange, akpm

On Tue, 18 Feb 2014 18:24:36 -0800 (PST)
David Rientjes <rientjes@google.com> wrote:

> Acked-by: David Rientjes <rientjes@google.com>
> 
> Might have been cleaner to move the 
> mmu_notifier_invalidate_range_{start,end}() to hugetlb_change_protection() 
> as well, though.

Way cleaner!  Second version attached :)

Thanks, David.

---8<---

Subject: move mmu notifier call from change_protection to change_pmd_range

The NUMA scanning code can end up iterating over many gigabytes
of unpopulated memory, especially in the case of a freshly started
KVM guest with lots of memory.

This results in the mmu notifier code being called even when
there are no mapped pages in a virtual address range. The amount
of time wasted can be enough to trigger soft lockup warnings
with very large KVM guests.

This patch moves the mmu notifier call to the pmd level, which
represents 1GB areas of memory on x86-64. Furthermore, the mmu
notifier code is only called from the address in the PMD where
present mappings are first encountered.

The hugetlbfs code is left alone for now; hugetlb mappings are
not relocatable, and as such are left alone by the NUMA code,
and should never trigger this problem to begin with.

Signed-off-by: Rik van Riel <riel@redhat.com>
Acked-by: David Rientjes <rientjes@google.com>
---
 mm/hugetlb.c  |  2 ++
 mm/mprotect.c | 15 ++++++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index c0d930f..f0c5dfb 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -3065,6 +3065,7 @@ unsigned long hugetlb_change_protection(struct vm_area_struct *vma,
 	BUG_ON(address >= end);
 	flush_cache_range(vma, address, end);
 
+	mmu_notifier_invalidate_range_start(mm, start, end);
 	mutex_lock(&vma->vm_file->f_mapping->i_mmap_mutex);
 	for (; address < end; address += huge_page_size(h)) {
 		spinlock_t *ptl;
@@ -3094,6 +3095,7 @@ unsigned long hugetlb_change_protection(struct vm_area_struct *vma,
 	 */
 	flush_tlb_range(vma, start, end);
 	mutex_unlock(&vma->vm_file->f_mapping->i_mmap_mutex);
+	mmu_notifier_invalidate_range_end(mm, start, end);
 
 	return pages << h->order;
 }
diff --git a/mm/mprotect.c b/mm/mprotect.c
index d790166..76146fa 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -115,9 +115,11 @@ static inline unsigned long change_pmd_range(struct vm_area_struct *vma,
 		pgprot_t newprot, int dirty_accountable, int prot_numa)
 {
 	pmd_t *pmd;
+	struct mm_struct *mm = vma->vm_mm;
 	unsigned long next;
 	unsigned long pages = 0;
 	unsigned long nr_huge_updates = 0;
+	unsigned long mni_start = 0;
 
 	pmd = pmd_offset(pud, addr);
 	do {
@@ -126,6 +128,13 @@ static inline unsigned long change_pmd_range(struct vm_area_struct *vma,
 		next = pmd_addr_end(addr, end);
 		if (!pmd_trans_huge(*pmd) && pmd_none_or_clear_bad(pmd))
 				continue;
+
+		/* invoke the mmu notifier if the pmd is populated */
+		if (!mni_start) {
+			mni_start = addr;
+			mmu_notifier_invalidate_range_start(mm, mni_start, end);
+		}
+
 		if (pmd_trans_huge(*pmd)) {
 			if (next - addr != HPAGE_PMD_SIZE)
 				split_huge_page_pmd(vma, addr, pmd);
@@ -149,6 +158,9 @@ static inline unsigned long change_pmd_range(struct vm_area_struct *vma,
 		pages += this_pages;
 	} while (pmd++, addr = next, addr != end);
 
+	if (mni_start)
+		mmu_notifier_invalidate_range_end(mm, mni_start, end);
+
 	if (nr_huge_updates)
 		count_vm_numa_events(NUMA_HUGE_PTE_UPDATES, nr_huge_updates);
 	return pages;
@@ -208,15 +220,12 @@ unsigned long change_protection(struct vm_area_struct *vma, unsigned long start,
 		       unsigned long end, pgprot_t newprot,
 		       int dirty_accountable, int prot_numa)
 {
-	struct mm_struct *mm = vma->vm_mm;
 	unsigned long pages;
 
-	mmu_notifier_invalidate_range_start(mm, start, end);
 	if (is_vm_hugetlb_page(vma))
 		pages = hugetlb_change_protection(vma, start, end, newprot);
 	else
 		pages = change_protection_range(vma, start, end, newprot, dirty_accountable, prot_numa);
-	mmu_notifier_invalidate_range_end(mm, start, end);
 
 	return pages;
 }

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH -mm 0/3] fix numa vs kvm scalability issue
  2014-02-18 22:12 [PATCH -mm 0/3] fix numa vs kvm scalability issue riel
                   ` (2 preceding siblings ...)
  2014-02-18 22:12 ` [PATCH -mm 3/3] move mmu notifier call from change_protection to change_pmd_range riel
@ 2014-02-19  8:59 ` Peter Zijlstra
  2014-02-19 19:28   ` Andrew Morton
  3 siblings, 1 reply; 10+ messages in thread
From: Peter Zijlstra @ 2014-02-19  8:59 UTC (permalink / raw)
  To: riel; +Cc: linux-kernel, kvm, linux-mm, chegu_vinod, aarcange, akpm

On Tue, Feb 18, 2014 at 05:12:43PM -0500, riel@redhat.com wrote:
> The NUMA scanning code can end up iterating over many gigabytes
> of unpopulated memory, especially in the case of a freshly started
> KVM guest with lots of memory.
> 
> This results in the mmu notifier code being called even when
> there are no mapped pages in a virtual address range. The amount
> of time wasted can be enough to trigger soft lockup warnings
> with very large (>2TB) KVM guests.
> 
> This patch moves the mmu notifier call to the pmd level, which
> represents 1GB areas of memory on x86-64. Furthermore, the mmu
> notifier code is only called from the address in the PMD where
> present mappings are first encountered.
> 
> The hugetlbfs code is left alone for now; hugetlb mappings are
> not relocatable, and as such are left alone by the NUMA code,
> and should never trigger this problem to begin with.
> 
> The series also adds a cond_resched to task_numa_work, to
> fix another potential latency issue.

Andrew, I'll pick up the first kernel/sched/ patch; do you want the
other two mm/ patches?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH -mm 0/3] fix numa vs kvm scalability issue
  2014-02-19  8:59 ` [PATCH -mm 0/3] fix numa vs kvm scalability issue Peter Zijlstra
@ 2014-02-19 19:28   ` Andrew Morton
  0 siblings, 0 replies; 10+ messages in thread
From: Andrew Morton @ 2014-02-19 19:28 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: riel, linux-kernel, kvm, linux-mm, chegu_vinod, aarcange

On Wed, 19 Feb 2014 09:59:17 +0100 Peter Zijlstra <peterz@infradead.org> wrote:

> On Tue, Feb 18, 2014 at 05:12:43PM -0500, riel@redhat.com wrote:
> > The NUMA scanning code can end up iterating over many gigabytes
> > of unpopulated memory, especially in the case of a freshly started
> > KVM guest with lots of memory.
> > 
> > This results in the mmu notifier code being called even when
> > there are no mapped pages in a virtual address range. The amount
> > of time wasted can be enough to trigger soft lockup warnings
> > with very large (>2TB) KVM guests.
> > 
> > This patch moves the mmu notifier call to the pmd level, which
> > represents 1GB areas of memory on x86-64. Furthermore, the mmu
> > notifier code is only called from the address in the PMD where
> > present mappings are first encountered.
> > 
> > The hugetlbfs code is left alone for now; hugetlb mappings are
> > not relocatable, and as such are left alone by the NUMA code,
> > and should never trigger this problem to begin with.
> > 
> > The series also adds a cond_resched to task_numa_work, to
> > fix another potential latency issue.
> 
> Andrew, I'll pick up the first kernel/sched/ patch; do you want the
> other two mm/ patches?

That works, thanks.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-02-19 19:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-18 22:12 [PATCH -mm 0/3] fix numa vs kvm scalability issue riel
2014-02-18 22:12 ` [PATCH -mm 1/3] sched,numa: add cond_resched to task_numa_work riel
2014-02-18 22:12 ` [PATCH -mm 2/3] mm,numa: reorganize change_pmd_range riel
2014-02-19  2:22   ` David Rientjes
2014-02-18 22:12 ` [PATCH -mm 3/3] move mmu notifier call from change_protection to change_pmd_range riel
2014-02-19  2:24   ` David Rientjes
2014-02-19  3:08     ` Rik van Riel
2014-02-19  3:18     ` [PATCH -mm v2 " Rik van Riel
2014-02-19  8:59 ` [PATCH -mm 0/3] fix numa vs kvm scalability issue Peter Zijlstra
2014-02-19 19:28   ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).