]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm-correctly-update-zone-managed_pages-fix-fix
authorJiang Liu <liuj97@gmail.com>
Thu, 27 Jun 2013 23:51:48 +0000 (09:51 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Jun 2013 06:37:42 +0000 (16:37 +1000)
When CONFIG_HIGHMEM is undefined, totalhigh_pages is defined as:
#define totalhigh_pages 0UL
Thus statement "totalhigh_pages += count" will cause build failure as:
  CC      mm/page_alloc.o
mm/page_alloc.c: In function `adjust_managed_page_count':
mm/page_alloc.c:5262:19: error: lvalue required as left operand of
assignment
make[1]: *** [mm/page_alloc.o] Error 1
make: *** [mm/page_alloc.o] Error 2

So we still need to use CONFIG_HIGHMEM to guard the statement.

Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c

index 12722217efbf5b45e5ed67ebc1bf0adb43b35719..8bbd39367e7a2b0b2b6ede9bf41761299d305433 100644 (file)
@@ -5203,8 +5203,10 @@ void adjust_managed_page_count(struct page *page, long count)
        spin_lock(&managed_page_count_lock);
        page_zone(page)->managed_pages += count;
        totalram_pages += count;
+#ifdef CONFIG_HIGHMEM
        if (PageHighMem(page))
                totalhigh_pages += count;
+#endif
        spin_unlock(&managed_page_count_lock);
 }