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


Groups > linux.kernel > #1456020 > unrolled thread

Re: [PATCH 01/34] mm, vmstat: add infrastructure for per-node vmstats

Started byReza Arbab <arbab@linux.vnet.ibm.com>
First post2016-08-03 22:50 +0200
Last post2016-08-03 22:50 +0200
Articles 1 — 1 participant

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: [PATCH 01/34] mm, vmstat: add infrastructure for per-node vmstats Reza Arbab <arbab@linux.vnet.ibm.com> - 2016-08-03 22:50 +0200

#1456020 — Re: [PATCH 01/34] mm, vmstat: add infrastructure for per-node vmstats

FromReza Arbab <arbab@linux.vnet.ibm.com>
Date2016-08-03 22:50 +0200
SubjectRe: [PATCH 01/34] mm, vmstat: add infrastructure for per-node vmstats
Message-ID<s2bgZ-7xN-5@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web