Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1460313 > unrolled thread

Re: mm: Initialise per_cpu_nodestats for all online pgdats at boot

Started byMel Gorman <mgorman@techsingularity.net>
First post2016-08-11 11:30 +0200
Last post2016-08-12 04:10 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: mm: Initialise per_cpu_nodestats for all online pgdats at boot Mel Gorman <mgorman@techsingularity.net> - 2016-08-11 11:30 +0200
    Re: mm: Initialise per_cpu_nodestats for all online pgdats at boot Reza Arbab <arbab@linux.vnet.ibm.com> - 2016-08-11 17:50 +0200
    [PATCH] mm: Initialize per_cpu_nodestats for hotadded pgdats Reza Arbab <arbab@linux.vnet.ibm.com> - 2016-08-11 18:10 +0200
      Re: [PATCH] mm: Initialize per_cpu_nodestats for hotadded pgdats Balbir Singh <bsingharora@gmail.com> - 2016-08-12 04:10 +0200

#1460313 — Re: mm: Initialise per_cpu_nodestats for all online pgdats at boot

FromMel Gorman <mgorman@techsingularity.net>
Date2016-08-11 11:30 +0200
SubjectRe: mm: Initialise per_cpu_nodestats for all online pgdats at boot
Message-ID<s4Utk-1Wo-31@gated-at.bofh.it>
On Wed, Aug 10, 2016 at 12:59:40PM -0500, Reza Arbab wrote:
> On Thu, Aug 04, 2016 at 10:24:04AM +0100, Mel Gorman wrote:
> >[    1.713998] Unable to handle kernel paging request for data at address 0xff7a10000
> >[    1.714164] Faulting instruction address: 0xc000000000270cd0
> >[    1.714304] Oops: Kernel access of bad area, sig: 11 [#1]
> >[    1.714414] SMP NR_CPUS=2048 NUMA PowerNV
> >[    1.714530] Modules linked in:
> >[    1.714647] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.7.0-kvm+ #118
> >[    1.714786] task: c000000ff0680010 task.stack: c000000ff0704000
> >[    1.714926] NIP: c000000000270cd0 LR: c000000000270ce8 CTR: 0000000000000000
> >[    1.715093] REGS: c000000ff0707900 TRAP: 0300   Not tainted  (4.7.0-kvm+)
> >[    1.715232] MSR: 9000000102009033 <SF,HV,VEC,EE,ME,IR,DR,RI,LE,TM[E]>  CR: 846b6824  XER: 20000000
> >[    1.715748] CFAR: c000000000008768 DAR: 0000000ff7a10000 DSISR: 42000000 SOFTE: 1
> >GPR00: c000000000270d08 c000000ff0707b80 c0000000011fb200 0000000000000000
> >GPR04: 0000000000000800 0000000000000000 0000000000000000 0000000000000000
> >GPR08: ffffffffffffffff 0000000000000000 0000000ff7a10000 c00000000122aae0
> >GPR12: c000000000a1e440 c00000000fb80000 c00000000000c188 0000000000000000
> >GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
> >GPR20: 0000000000000000 0000000000000000 0000000000000000 c000000000cecad0
> >GPR24: c000000000d035b8 c000000000d6cd18 c000000000d6cd18 c000001fffa86300
> >GPR28: 0000000000000000 c000001fffa96300 c000000001230034 c00000000122eb18
> >[    1.717484] NIP [c000000000270cd0] refresh_zone_stat_thresholds+0x80/0x240
> >[    1.717568] LR [c000000000270ce8] refresh_zone_stat_thresholds+0x98/0x240
> >[    1.717648] Call Trace:
> >[    1.717687] [c000000ff0707b80] [c000000000270d08] refresh_zone_stat_thresholds+0xb8/0x240 (unreliable)
> 
> I've been investigating node hotplug. That path is also going to require
> initialization of per_cpu_nodestats. This worked for me:
> 

Fix looks ok. Can you add a proper changelog to it including an example
oops or do you need me to do it?

-- 
Mel Gorman
SUSE Labs

[toc] | [next] | [standalone]


#1460629

FromReza Arbab <arbab@linux.vnet.ibm.com>
Date2016-08-11 17:50 +0200
Message-ID<s50p4-5GR-45@gated-at.bofh.it>
In reply to#1460313
On Thu, Aug 11, 2016 at 10:28:08AM +0100, Mel Gorman wrote:
>Fix looks ok. Can you add a proper changelog to it including an example
>oops or do you need me to do it?

Sure, no problem. Patch to follow.

-- 
Reza Arbab

[toc] | [prev] | [next] | [standalone]


#1460642 — [PATCH] mm: Initialize per_cpu_nodestats for hotadded pgdats

FromReza Arbab <arbab@linux.vnet.ibm.com>
Date2016-08-11 18:10 +0200
Subject[PATCH] mm: Initialize per_cpu_nodestats for hotadded pgdats
Message-ID<s50Ip-633-3@gated-at.bofh.it>
In reply to#1460313
The following oops occurs after a pgdat is hotadded:

[   86.839956] Unable to handle kernel paging request for data at address 0x00c30001
[   86.840132] Faulting instruction address: 0xc00000000022f8f4
[   86.840328] Oops: Kernel access of bad area, sig: 11 [#1]
[   86.840468] SMP NR_CPUS=2048 NUMA pSeries
[   86.840612] Modules linked in: ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 ipt_REJECT nf_reject_ipv4 xt_conntrack ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw iptable_filter nls_utf8 isofs sg virtio_balloon uio_pdrv_genirq uio ip_tables xfs libcrc32c sr_mod cdrom sd_mod virtio_net ibmvscsi scsi_transport_srp virtio_pci virtio_ring virtio dm_mirror dm_region_hash dm_log dm_mod
[   86.842955] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W 4.8.0-rc1-device #110
[   86.843140] task: c000000000ef3080 task.stack: c000000000f6c000
[   86.843323] NIP: c00000000022f8f4 LR: c00000000022f948 CTR: 0000000000000000
[   86.843595] REGS: c000000000f6fa50 TRAP: 0300   Tainted: G        W (4.8.0-rc1-device)
[   86.843889] MSR: 800000010280b033 <SF,VEC,VSX,EE,FP,ME,IR,DR,RI,LE,TM[E]>  CR: 84002028  XER: 20000000
[   86.844624] CFAR: d000000001d2013c DAR: 0000000000c30001 DSISR: 40000000 SOFTE: 0
GPR00: c00000000022f948 c000000000f6fcd0 c000000000f71400 0000000000000001
GPR04: 0000000000000100 0000000000000000 0000000000000000 0000000000c30000
GPR08: ffffffffffffffff 0000000000000001 0000000000c30000 00000000ffffffff
GPR12: 0000000000002200 c000000001300000 c000000000faefb4 c000000000faefa8
GPR16: c000000000f6c000 c000000000f6c080 c000000000bf15b0 c000000000f6c080
GPR20: c000000000bf4928 0000000000000000 0000000000000003 c000000000bf4968
GPR24: c0000000ffed0000 0000000000000000 0000000000000000 c000000000f6fd58
GPR28: 0000000000000001 0000000000000001 c000000000f6fcf0 c0000000ffed9c08
[   86.847747] NIP [c00000000022f8f4] refresh_cpu_vm_stats+0x1a4/0x2f0
[   86.847897] LR [c00000000022f948] refresh_cpu_vm_stats+0x1f8/0x2f0
[   86.848060] Call Trace:
[   86.848183] [c000000000f6fcd0] [c00000000022f948] refresh_cpu_vm_stats+0x1f8/0x2f0 (unreliable)

Add per_cpu_nodestats initialization to the hotplug codepath.

Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com>
---
 mm/memory_hotplug.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 3894b65..41266dc 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1219,6 +1219,7 @@ static pg_data_t __ref *hotadd_new_pgdat(int nid, u64 start)
 
 	/* init node's zones as empty zones, we don't have any present pages.*/
 	free_area_init_node(nid, zones_size, start_pfn, zholes_size);
+	pgdat->per_cpu_nodestats = alloc_percpu(struct per_cpu_nodestat);
 
 	/*
 	 * The node we allocated has no zone fallback lists. For avoiding
@@ -1249,6 +1250,7 @@ static pg_data_t __ref *hotadd_new_pgdat(int nid, u64 start)
 static void rollback_node_hotadd(int nid, pg_data_t *pgdat)
 {
 	arch_refresh_nodedata(nid, NULL);
+	free_percpu(pgdat->per_cpu_nodestats);
 	arch_free_nodedata(pgdat);
 	return;
 }
-- 
1.8.3.1

[toc] | [prev] | [next] | [standalone]


#1460894 — Re: [PATCH] mm: Initialize per_cpu_nodestats for hotadded pgdats

FromBalbir Singh <bsingharora@gmail.com>
Date2016-08-12 04:10 +0200
SubjectRe: [PATCH] mm: Initialize per_cpu_nodestats for hotadded pgdats
Message-ID<s5a53-3RF-1@gated-at.bofh.it>
In reply to#1460642

On 12/08/16 02:04, Reza Arbab wrote:
> The following oops occurs after a pgdat is hotadded:
> 
> [   86.839956] Unable to handle kernel paging request for data at address 0x00c30001
> [   86.840132] Faulting instruction address: 0xc00000000022f8f4
> [   86.840328] Oops: Kernel access of bad area, sig: 11 [#1]
> [   86.840468] SMP NR_CPUS=2048 NUMA pSeries
> [   86.840612] Modules linked in: ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 ipt_REJECT nf_reject_ipv4 xt_conntrack ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_security ip6table_raw ip6table_filter ip6_tables iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_security iptable_raw iptable_filter nls_utf8 isofs sg virtio_balloon uio_pdrv_genirq uio ip_tables xfs libcrc32c sr_mod cdrom sd_mod virtio_net ibmvscsi scsi_transport_srp virtio_pci virtio_ring virtio dm_mirror dm_region_hash dm_log dm_mod
> [   86.842955] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W 4.8.0-rc1-device #110
> [   86.843140] task: c000000000ef3080 task.stack: c000000000f6c000
> [   86.843323] NIP: c00000000022f8f4 LR: c00000000022f948 CTR: 0000000000000000
> [   86.843595] REGS: c000000000f6fa50 TRAP: 0300   Tainted: G        W (4.8.0-rc1-device)
> [   86.843889] MSR: 800000010280b033 <SF,VEC,VSX,EE,FP,ME,IR,DR,RI,LE,TM[E]>  CR: 84002028  XER: 20000000
> [   86.844624] CFAR: d000000001d2013c DAR: 0000000000c30001 DSISR: 40000000 SOFTE: 0
> GPR00: c00000000022f948 c000000000f6fcd0 c000000000f71400 0000000000000001
> GPR04: 0000000000000100 0000000000000000 0000000000000000 0000000000c30000
> GPR08: ffffffffffffffff 0000000000000001 0000000000c30000 00000000ffffffff
> GPR12: 0000000000002200 c000000001300000 c000000000faefb4 c000000000faefa8
> GPR16: c000000000f6c000 c000000000f6c080 c000000000bf15b0 c000000000f6c080
> GPR20: c000000000bf4928 0000000000000000 0000000000000003 c000000000bf4968
> GPR24: c0000000ffed0000 0000000000000000 0000000000000000 c000000000f6fd58
> GPR28: 0000000000000001 0000000000000001 c000000000f6fcf0 c0000000ffed9c08
> [   86.847747] NIP [c00000000022f8f4] refresh_cpu_vm_stats+0x1a4/0x2f0
> [   86.847897] LR [c00000000022f948] refresh_cpu_vm_stats+0x1f8/0x2f0
> [   86.848060] Call Trace:
> [   86.848183] [c000000000f6fcd0] [c00000000022f948] refresh_cpu_vm_stats+0x1f8/0x2f0 (unreliable)
> 
> Add per_cpu_nodestats initialization to the hotplug codepath.
> 
> Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com>
> ---
>  mm/memory_hotplug.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 3894b65..41266dc 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -1219,6 +1219,7 @@ static pg_data_t __ref *hotadd_new_pgdat(int nid, u64 start)
>  
>  	/* init node's zones as empty zones, we don't have any present pages.*/
>  	free_area_init_node(nid, zones_size, start_pfn, zholes_size);
> +	pgdat->per_cpu_nodestats = alloc_percpu(struct per_cpu_nodestat);
>  
>  	/*
>  	 * The node we allocated has no zone fallback lists. For avoiding
> @@ -1249,6 +1250,7 @@ static pg_data_t __ref *hotadd_new_pgdat(int nid, u64 start)
>  static void rollback_node_hotadd(int nid, pg_data_t *pgdat)
>  {
>  	arch_refresh_nodedata(nid, NULL);
> +	free_percpu(pgdat->per_cpu_nodestats);
>  	arch_free_nodedata(pgdat);
>  	return;
>  }
> 

I wonder if node_set_online() should do the allocation and offline should free.
But that would be a larger change

Balbir

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web