All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 7/8] sched, numa: do not hint for NUMA balancing on VM_MIXEDMAP mappings
@ 2015-06-10 18:15 akpm
  2015-06-11  6:18 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2015-06-10 18:15 UTC (permalink / raw)
  To: torvalds, akpm, mgorman, a.p.zijlstra, jovi, mingo, stable

From: Mel Gorman <mgorman@suse.de>
Subject: sched, numa: do not hint for NUMA balancing on VM_MIXEDMAP mappings

Jovi Zhangwei reported the following problem

  Below kernel vm bug can be triggered by tcpdump which mmaped a lot of pages
  with GFP_COMP flag.

  [Mon May 25 05:29:33 2015] page:ffffea0015414000 count:66 mapcount:1 mapping:          (null) index:0x0
  [Mon May 25 05:29:33 2015] flags: 0x20047580004000(head)
  [Mon May 25 05:29:33 2015] page dumped because: VM_BUG_ON_PAGE(compound_order(page) && !PageTransHuge(page))
  [Mon May 25 05:29:33 2015] ------------[ cut here ]------------
  [Mon May 25 05:29:33 2015] kernel BUG at mm/migrate.c:1661!
  [Mon May 25 05:29:33 2015] invalid opcode: 0000 [#1] SMP

In this case it was triggered by running tcpdump but it's not necessary
reproducible on all systems.

  sudo tcpdump -i bond0.100 'tcp port 4242' -c 100000000000 -w 4242.pcap

Compound pages cannot be migrated and it was not expected that such pages
be marked for NUMA balancing.  This did not take into account that drivers
such as net/packet/af_packet.c may insert compound pages into userspace
with vm_insert_page.  This patch tells the NUMA balancing protection
scanner to skip all VM_MIXEDMAP mappings which avoids the possibility that
compound pages are marked for migration.

Signed-off-by: Mel Gorman <mgorman@suse.de>
Reported-by: Jovi Zhangwei <jovi@cloudflare.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/sched/fair.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN kernel/sched/fair.c~sched-numa-do-not-hint-for-numa-balancing-on-vm_mixedmap-mappings kernel/sched/fair.c
--- a/kernel/sched/fair.c~sched-numa-do-not-hint-for-numa-balancing-on-vm_mixedmap-mappings
+++ a/kernel/sched/fair.c
@@ -2181,7 +2181,7 @@ void task_numa_work(struct callback_head
 	}
 	for (; vma; vma = vma->vm_next) {
 		if (!vma_migratable(vma) || !vma_policy_mof(vma) ||
-			is_vm_hugetlb_page(vma)) {
+			is_vm_hugetlb_page(vma) || (vma->vm_flags & VM_MIXEDMAP)) {
 			continue;
 		}
 
_

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

* Re: [patch 7/8] sched, numa: do not hint for NUMA balancing on VM_MIXEDMAP mappings
  2015-06-10 18:15 [patch 7/8] sched, numa: do not hint for NUMA balancing on VM_MIXEDMAP mappings akpm
@ 2015-06-11  6:18 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2015-06-11  6:18 UTC (permalink / raw)
  To: akpm; +Cc: torvalds, mgorman, a.p.zijlstra, jovi, mingo, stable


* akpm@linux-foundation.org <akpm@linux-foundation.org> wrote:

> From: Mel Gorman <mgorman@suse.de>
> Subject: sched, numa: do not hint for NUMA balancing on VM_MIXEDMAP mappings
> 
> Jovi Zhangwei reported the following problem
> 
>   Below kernel vm bug can be triggered by tcpdump which mmaped a lot of pages
>   with GFP_COMP flag.
> 
>   [Mon May 25 05:29:33 2015] page:ffffea0015414000 count:66 mapcount:1 mapping:          (null) index:0x0
>   [Mon May 25 05:29:33 2015] flags: 0x20047580004000(head)
>   [Mon May 25 05:29:33 2015] page dumped because: VM_BUG_ON_PAGE(compound_order(page) && !PageTransHuge(page))
>   [Mon May 25 05:29:33 2015] ------------[ cut here ]------------
>   [Mon May 25 05:29:33 2015] kernel BUG at mm/migrate.c:1661!
>   [Mon May 25 05:29:33 2015] invalid opcode: 0000 [#1] SMP

> --- a/kernel/sched/fair.c~sched-numa-do-not-hint-for-numa-balancing-on-vm_mixedmap-mappings
> +++ a/kernel/sched/fair.c
> @@ -2181,7 +2181,7 @@ void task_numa_work(struct callback_head
>  	}
>  	for (; vma; vma = vma->vm_next) {
>  		if (!vma_migratable(vma) || !vma_policy_mof(vma) ||
> -			is_vm_hugetlb_page(vma)) {
> +			is_vm_hugetlb_page(vma) || (vma->vm_flags & VM_MIXEDMAP)) {
>  			continue;
>  		}

the fix looks good to me, but this should really be done in a bit cleaner fashion, 
by breaking out an vma_numa_migratable() inline helper or so? Anyway:

Acked-by: Ingo Molnar <mingo@kernel.org>

Thanks,

	Ingo

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

end of thread, other threads:[~2015-06-11  6:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-10 18:15 [patch 7/8] sched, numa: do not hint for NUMA balancing on VM_MIXEDMAP mappings akpm
2015-06-11  6:18 ` Ingo Molnar

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.