lkml.org 
[lkml]   [2016]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 01/34] mm, vmstat: add infrastructure for per-node vmstats
On Fri, Jul 08, 2016 at 10:34:37AM +0100, Mel Gorman wrote:
> void refresh_zone_stat_thresholds(void)
> {
[...]
>+ /* Zero current pgdat thresholds */
>+ for_each_online_pgdat(pgdat) {
>+ for_each_online_cpu(cpu) {
>+ per_cpu_ptr(pgdat->per_cpu_nodestats, cpu)->stat_threshold = 0;
>+ }
>+ }

I am oopsing here, for a node whose pgdat->per_cpu_nodestats is NULL.

The node in question is memoryless, so in setup_per_cpu_pageset(), the
loop over its populated zones doesn't run, and the per_cpu_nodestat
struct isn't allocated.

This patch fixes things for me:

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index ea759b9..5221e17 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5271,9 +5271,17 @@ static void __meminit setup_zone_pageset(struct zone *zone)
void __init setup_per_cpu_pageset(void)
{
struct zone *zone;
+ struct pglist_data *pgdat;

for_each_populated_zone(zone)
setup_zone_pageset(zone);
+
+ for_each_online_pgdat(pgdat) {
+ if (!pgdat->per_cpu_nodestats) {
+ pgdat->per_cpu_nodestats =
+ alloc_percpu(struct per_cpu_nodestat);
+ }
+ }
}

static noinline __init_refok

--
Reza Arbab

\
 
 \ /
  Last update: 2016-08-03 23:21    [W:0.332 / U:8.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site