Skip to content

Commit 1b49ed7

Browse files
gormanm0day robot
authored andcommitted
mm: Initialise per_cpu_nodestats for all online pgdats at boot
Paul Mackerras and Reza Arbab reported that machines with memoryless nodes fails when vmstats are refreshed. Paul reported an oops as follows [ 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+ torvalds#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) Both supplied potential fixes but one potentially misses checks and another had redundant initialisations. This version initialises per_cpu_nodestats on a per-pgdat basis instead of on a per-zone basis. Reported-by: Paul Mackerras <[email protected]> Reported-by: Reza Arbab <[email protected]> Signed-off-by: Mel Gorman <[email protected]>
1 parent 63590ec commit 1b49ed7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mm/page_alloc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5289,11 +5289,6 @@ static void __meminit setup_zone_pageset(struct zone *zone)
52895289
zone->pageset = alloc_percpu(struct per_cpu_pageset);
52905290
for_each_possible_cpu(cpu)
52915291
zone_pageset_init(zone, cpu);
5292-
5293-
if (!zone->zone_pgdat->per_cpu_nodestats) {
5294-
zone->zone_pgdat->per_cpu_nodestats =
5295-
alloc_percpu(struct per_cpu_nodestat);
5296-
}
52975292
}
52985293

52995294
/*
@@ -5302,10 +5297,15 @@ static void __meminit setup_zone_pageset(struct zone *zone)
53025297
*/
53035298
void __init setup_per_cpu_pageset(void)
53045299
{
5300+
struct pglist_data *pgdat;
53055301
struct zone *zone;
53065302

53075303
for_each_populated_zone(zone)
53085304
setup_zone_pageset(zone);
5305+
5306+
for_each_online_pgdat(pgdat)
5307+
pgdat->per_cpu_nodestats =
5308+
alloc_percpu(struct per_cpu_nodestat);
53095309
}
53105310

53115311
static noinline __ref

0 commit comments

Comments
 (0)