All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: fix a regression with HIGHMEM introduced by changeset 7f1290f2f2a4d
@ 2012-11-06  1:31 ` Jiang Liu
  0 siblings, 0 replies; 98+ messages in thread
From: Jiang Liu @ 2012-11-06  1:31 UTC (permalink / raw)
  To: Andrew Morton, Maciej Rutecki
  Cc: Jiang Liu, Jianguo Wu, Chris Clayton, Rafael J. Wysocki,
	Mel Gorman, Minchan Kim, KAMEZAWA Hiroyuki, Michal Hocko,
	linux-mm, linux-kernel

Changeset 7f1290f2f2 tries to fix a issue when calculating
zone->present_pages, but it causes a regression to 32bit systems with
HIGHMEM. With that changeset, function reset_zone_present_pages()
resets all zone->present_pages to zero, and fixup_zone_present_pages()
is called to recalculate zone->present_pages when boot allocator frees
core memory pages into buddy allocator. Because highmem pages are not
freed by bootmem allocator, all highmem zones' present_pages becomes
zero.

Actually there's no need to recalculate present_pages for highmem zone
because bootmem allocator never allocates pages from them. So fix the
regression by skipping highmem in function reset_zone_present_pages()
and fixup_zone_present_pages().

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Jianguo Wu <wujianguo@huawei.com>
Reported-by: Maciej Rutecki <maciej.rutecki@gmail.com>
Tested-by: Maciej Rutecki <maciej.rutecki@gmail.com>
Cc: Chris Clayton <chris2553@googlemail.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Minchan Kim <minchan@kernel.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org

---

Hi Maciej,
	Thanks for reporting and bisecting. We have analyzed the regression
and worked out a patch for it. Could you please help to verify whether it
fix the regression?
	Thanks!
	Gerry

---
 mm/page_alloc.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 5b74de6..2311f15 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -6108,7 +6108,8 @@ void reset_zone_present_pages(void)
 	for_each_node_state(nid, N_HIGH_MEMORY) {
 		for (i = 0; i < MAX_NR_ZONES; i++) {
 			z = NODE_DATA(nid)->node_zones + i;
-			z->present_pages = 0;
+			if (!is_highmem(z))
+				z->present_pages = 0;
 		}
 	}
 }
@@ -6123,10 +6124,11 @@ void fixup_zone_present_pages(int nid, unsigned long start_pfn,
 
 	for (i = 0; i < MAX_NR_ZONES; i++) {
 		z = NODE_DATA(nid)->node_zones + i;
+		if (is_highmem(z))
+			continue;
+
 		zone_start_pfn = z->zone_start_pfn;
 		zone_end_pfn = zone_start_pfn + z->spanned_pages;
-
-		/* if the two regions intersect */
 		if (!(zone_start_pfn >= end_pfn	|| zone_end_pfn <= start_pfn))
 			z->present_pages += min(end_pfn, zone_end_pfn) -
 					    max(start_pfn, zone_start_pfn);
-- 
1.7.1



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

end of thread, other threads:[~2012-12-04 10:05 UTC | newest]

Thread overview: 98+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-06  1:31 [PATCH] mm: fix a regression with HIGHMEM introduced by changeset 7f1290f2f2a4d Jiang Liu
2012-11-06  1:31 ` Jiang Liu
2012-11-06 10:23 ` Chris Clayton
2012-11-06 10:23   ` Chris Clayton
2012-11-06 20:43 ` Andrew Morton
2012-11-06 20:43   ` Andrew Morton
2012-11-14 14:52   ` Jiang Liu
2012-11-14 14:52     ` Jiang Liu
2012-11-15  9:22     ` Wen Congyang
2012-11-15  9:22       ` Wen Congyang
2012-11-15 11:28       ` Bob Liu
2012-11-15 11:28         ` Bob Liu
2012-11-15 14:23         ` Wen Congyang
2012-11-15 14:23           ` Wen Congyang
2012-11-15 15:40       ` Jiang Liu
2012-11-15 15:40         ` Jiang Liu
2012-11-15 21:41         ` David Rientjes
2012-11-15 21:41           ` David Rientjes
2012-11-15 19:24     ` Andrew Morton
2012-11-15 19:24       ` Andrew Morton
2012-11-15 21:17       ` Chris Clayton
2012-11-15 21:17         ` Chris Clayton
2012-11-15 21:27       ` David Rientjes
2012-11-15 21:27         ` David Rientjes
2012-11-18 16:07       ` [RFT PATCH v1 0/5] fix up inaccurate zone->present_pages Jiang Liu
2012-11-18 16:07         ` Jiang Liu
2012-11-18 16:07         ` [RFT PATCH v1 1/5] mm: introduce new field "managed_pages" to struct zone Jiang Liu
2012-11-18 16:07           ` Jiang Liu
2012-11-19 23:38           ` Andrew Morton
2012-11-19 23:38             ` Andrew Morton
2012-11-20 14:56             ` Jiang Liu
2012-11-20 14:56               ` Jiang Liu
2012-11-20 19:31               ` Andrew Morton
2012-11-20 19:31                 ` Andrew Morton
2012-11-21 14:36                 ` Jiang Liu
2012-11-21 14:36                   ` Jiang Liu
2012-11-21 19:31                   ` Andrew Morton
2012-11-21 19:31                     ` Andrew Morton
2012-11-21 15:06                 ` [RFT PATCH v2 " Jiang Liu
2012-11-21 15:06                   ` Jiang Liu
2012-11-18 16:07         ` [RFT PATCH v1 2/5] mm: replace zone->present_pages with zone->managed_pages if appreciated Jiang Liu
2012-11-18 16:07           ` Jiang Liu
2012-11-18 16:07         ` [RFT PATCH v1 3/5] mm: set zone->present_pages to number of existing pages in the zone Jiang Liu
2012-11-18 16:07           ` Jiang Liu
2012-11-18 16:07         ` [RFT PATCH v1 4/5] mm: provide more accurate estimation of pages occupied by memmap Jiang Liu
2012-11-18 16:07           ` Jiang Liu
2012-11-19 23:42           ` Andrew Morton
2012-11-19 23:42             ` Andrew Morton
2012-11-20 15:18             ` Jiang Liu
2012-11-20 15:18               ` Jiang Liu
2012-11-20 19:19               ` Andrew Morton
2012-11-20 19:19                 ` Andrew Morton
2012-11-21 14:52                 ` Jiang Liu
2012-11-21 14:52                   ` Jiang Liu
2012-11-21 19:35                   ` Andrew Morton
2012-11-21 19:35                     ` Andrew Morton
2012-11-22 16:17                     ` Jiang Liu
2012-11-22 16:17                       ` Jiang Liu
2012-11-21 15:09                 ` [RFT PATCH v2 " Jiang Liu
2012-11-21 15:09                   ` Jiang Liu
2012-11-28 23:52                   ` Andrew Morton
2012-11-28 23:52                     ` Andrew Morton
2012-11-29  2:25                     ` Jianguo Wu
2012-11-29  2:25                       ` Jianguo Wu
2012-11-29 10:52                     ` Chris Clayton
2012-11-29 10:52                       ` Chris Clayton
2012-12-02 19:55                       ` Chris Clayton
2012-12-02 19:55                         ` Chris Clayton
2012-12-03  7:26                         ` Chris Clayton
2012-12-03  7:26                           ` Chris Clayton
2012-12-03 23:17                         ` Andrew Morton
2012-12-03 23:17                           ` Andrew Morton
2012-12-04  1:21                           ` Jiang Liu
2012-12-04  1:21                             ` Jiang Liu
2012-12-04 10:05                           ` Chris Clayton
2012-12-04 10:05                             ` Chris Clayton
2012-11-20  2:15           ` [RFT PATCH v1 " Jaegeuk Hanse
2012-11-20  2:15             ` Jaegeuk Hanse
2012-11-18 16:07         ` [RFT PATCH v1 5/5] mm: increase totalram_pages when free pages allocated by bootmem allocator Jiang Liu
2012-11-18 16:07           ` Jiang Liu
2012-11-18 20:36         ` [RFT PATCH v1 0/5] fix up inaccurate zone->present_pages Chris Clayton
2012-11-18 20:36           ` Chris Clayton
2012-11-22  9:23           ` Chris Clayton
2012-11-22  9:23             ` Chris Clayton
2012-11-26  9:46             ` Chris Clayton
2012-11-26  9:46               ` Chris Clayton
2012-11-19 21:36         ` Maciej Rutecki
2012-11-19 21:36           ` Maciej Rutecki
2012-11-20 16:03           ` Jiang Liu
2012-11-20 16:03             ` Jiang Liu
2012-11-20  2:13         ` Jaegeuk Hanse
2012-11-20  2:13           ` Jaegeuk Hanse
2012-11-20  2:43           ` Jiang Liu
2012-11-20  2:43             ` Jiang Liu
2012-11-20  3:20             ` Jaegeuk Hanse
2012-11-20  3:20               ` Jaegeuk Hanse
2012-11-20  3:46               ` Jiang Liu
2012-11-20  3:46                 ` Jiang Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.