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


Groups > linux.kernel > #1457065 > unrolled thread

[PATCH] metag: Drop show_mem() from mem_init()

Started byJames Hogan <james.hogan@imgtec.com>
First post2016-08-05 14:20 +0200
Last post2016-08-05 14:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] metag: Drop show_mem() from mem_init() James Hogan <james.hogan@imgtec.com> - 2016-08-05 14:20 +0200
    Re: [PATCH] metag: Drop show_mem() from mem_init() Mel Gorman <mgorman@techsingularity.net> - 2016-08-05 14:40 +0200

#1457065 — [PATCH] metag: Drop show_mem() from mem_init()

FromJames Hogan <james.hogan@imgtec.com>
Date2016-08-05 14:20 +0200
Subject[PATCH] metag: Drop show_mem() from mem_init()
Message-ID<s2Mgy-7oy-15@gated-at.bofh.it>
The recent commit 599d0c954f91 ("mm, vmscan: move LRU lists to node"),
changed memory management code so that show_mem() is no longer safe to
call prior to setup_per_cpu_pageset(), as pgdat->per_cpu_nodestats will
still be NULL. This causes an oops on metag due to the call to
show_mem() from mem_init():

  node_page_state_snapshot(...) + 0x48
  pgdat_reclaimable(struct pglist_data * pgdat = 0x402517a0)
  show_free_areas(unsigned int filter = 0) + 0x2cc
  show_mem(unsigned int filter = 0) + 0x18
  mem_init()
  mm_init()
  start_kernel() + 0x204

This wasn't a problem before with zone_reclaimable() as zone_pcp_init()
was already setting zone->pageset to &boot_pageset, via setup_arch() and
paging_init(), which happens before mm_init():

  zone_pcp_init(...)
  free_area_init_core(...) + 0x138
  free_area_init_node(int nid = 0, ...) + 0x1a0
  free_area_init_nodes(...) + 0x440
  paging_init(unsigned long mem_end = 0x4fe00000) + 0x378
  setup_arch(char ** cmdline_p = 0x4024e038) + 0x2b8
  start_kernel() + 0x54

No other arches appear to call show_mem() during boot, and it doesn't
really add much value to the log, so lets just drop it from mem_init().

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: linux-metag@vger.kernel.org
---
 arch/metag/mm/init.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/metag/mm/init.c b/arch/metag/mm/init.c
index 11fa51c89617..c0ec116b3993 100644
--- a/arch/metag/mm/init.c
+++ b/arch/metag/mm/init.c
@@ -390,7 +390,6 @@ void __init mem_init(void)
 
 	free_all_bootmem();
 	mem_init_print_info(NULL);
-	show_mem(0);
 }
 
 void free_initmem(void)
-- 
2.9.2

[toc] | [next] | [standalone]


#1457074

FromMel Gorman <mgorman@techsingularity.net>
Date2016-08-05 14:40 +0200
Message-ID<s2MzU-7vn-5@gated-at.bofh.it>
In reply to#1457065
On Fri, Aug 05, 2016 at 01:17:04PM +0100, James Hogan wrote:
> The recent commit 599d0c954f91 ("mm, vmscan: move LRU lists to node"),
> changed memory management code so that show_mem() is no longer safe to
> call prior to setup_per_cpu_pageset(), as pgdat->per_cpu_nodestats will
> still be NULL. This causes an oops on metag due to the call to
> show_mem() from mem_init():
> 
>   node_page_state_snapshot(...) + 0x48
>   pgdat_reclaimable(struct pglist_data * pgdat = 0x402517a0)
>   show_free_areas(unsigned int filter = 0) + 0x2cc
>   show_mem(unsigned int filter = 0) + 0x18
>   mem_init()
>   mm_init()
>   start_kernel() + 0x204
> 
> This wasn't a problem before with zone_reclaimable() as zone_pcp_init()
> was already setting zone->pageset to &boot_pageset, via setup_arch() and
> paging_init(), which happens before mm_init():
> 
>   zone_pcp_init(...)
>   free_area_init_core(...) + 0x138
>   free_area_init_node(int nid = 0, ...) + 0x1a0
>   free_area_init_nodes(...) + 0x440
>   paging_init(unsigned long mem_end = 0x4fe00000) + 0x378
>   setup_arch(char ** cmdline_p = 0x4024e038) + 0x2b8
>   start_kernel() + 0x54
> 
> No other arches appear to call show_mem() during boot, and it doesn't
> really add much value to the log, so lets just drop it from mem_init().
> 
> Signed-off-by: James Hogan <james.hogan@imgtec.com>
> Cc: Mel Gorman <mgorman@techsingularity.net>

Acked-by: Mel Gorman <mgorman@techsingularity.net>

-- 
Mel Gorman
SUSE Labs

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web