linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm, show_mem: drop pgdat_resize_lock in show_mem()
@ 2018-11-28 21:08 Wei Yang
  2018-11-28 22:07 ` Andrew Morton
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Wei Yang @ 2018-11-28 21:08 UTC (permalink / raw)
  To: mhocko, akpm, jweiner; +Cc: linux-mm, Wei Yang

Function show_mem() is used to print system memory status when user
requires or fail to allocate memory. Generally, this is a best effort
information and not willing to affect core mm subsystem.

The data protected by pgdat_resize_lock is mostly correct except there is:

   * page struct defer init
   * memory hotplug

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 lib/show_mem.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/lib/show_mem.c b/lib/show_mem.c
index 0beaa1d899aa..1d996e5771ab 100644
--- a/lib/show_mem.c
+++ b/lib/show_mem.c
@@ -21,7 +21,6 @@ void show_mem(unsigned int filter, nodemask_t *nodemask)
 		unsigned long flags;
 		int zoneid;
 
-		pgdat_resize_lock(pgdat, &flags);
 		for (zoneid = 0; zoneid < MAX_NR_ZONES; zoneid++) {
 			struct zone *zone = &pgdat->node_zones[zoneid];
 			if (!populated_zone(zone))
@@ -33,7 +32,6 @@ void show_mem(unsigned int filter, nodemask_t *nodemask)
 			if (is_highmem_idx(zoneid))
 				highmem += zone->present_pages;
 		}
-		pgdat_resize_unlock(pgdat, &flags);
 	}
 
 	printk("%lu pages RAM\n", total);
-- 
2.15.1

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-11-30  8:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-28 21:08 [PATCH] mm, show_mem: drop pgdat_resize_lock in show_mem() Wei Yang
2018-11-28 22:07 ` Andrew Morton
2018-11-29  1:52   ` Wei Yang
2018-11-29  8:17 ` Michal Hocko
2018-11-29  9:32   ` Wei Yang
2018-11-29 15:04   ` Wei Yang
2018-11-29 15:49     ` Michal Hocko
2018-11-29 16:05       ` Wei Yang
2018-11-29 16:18         ` Michal Hocko
2018-11-29 23:49           ` Wei Yang
2018-11-29 23:55 ` [PATCH v2] " Wei Yang
2018-11-30  8:17   ` Michal Hocko
2018-11-30  8:54   ` osalvador

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox