[PATCH] mm: remove PG_highmem
authorBadari Pulavarty <pbadari@us.ibm.com>
Wed, 22 Jun 2005 00:14:52 +0000 (17:14 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 22 Jun 2005 01:46:17 +0000 (18:46 -0700)
Remove PG_highmem, to save a page flag.  Use is_highmem() instead.  It'll
generate a little more code, but we don't use PageHigheMem() in many places.

Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/frv/mm/init.c
arch/i386/mm/init.c
arch/mips/mm/init.c
arch/ppc/mm/init.c
arch/sparc/mm/init.c
arch/um/kernel/mem.c
include/linux/page-flags.h

index 41958f57c83864c4a8f62becaac334ea1173833e..79433159b5f05a7bbb3022c5a89b6555247f3090 100644 (file)
@@ -169,7 +169,6 @@ void __init mem_init(void)
                struct page *page = &mem_map[pfn];
 
                ClearPageReserved(page);
-               set_bit(PG_highmem, &page->flags);
                set_page_count(page, 1);
                __free_page(page);
                totalram_pages++;
index 7a7ea3737265284eceafdcdc82000f3c87d06690..8766c771bb45371ab1f67e94112616ba86521a9e 100644 (file)
@@ -269,7 +269,6 @@ void __init one_highpage_init(struct page *page, int pfn, int bad_ppro)
 {
        if (page_is_ram(pfn) && !(bad_ppro && page_kills_ppro(pfn))) {
                ClearPageReserved(page);
-               set_bit(PG_highmem, &page->flags);
                set_page_count(page, 1);
                __free_page(page);
                totalhigh_pages++;
index b027ce7efbc67c2246a6cc21c0ecb56b4d01ae7e..73843c5287782f3ef74a6adaec316445c8e20764 100644 (file)
@@ -232,7 +232,6 @@ void __init mem_init(void)
 #ifdef CONFIG_LIMITED_DMA
                set_page_address(page, lowmem_page_address(page));
 #endif
-               set_bit(PG_highmem, &page->flags);
                set_page_count(page, 1);
                __free_page(page);
                totalhigh_pages++;
index 363c157e3617e8f375b0bbae6f31fd499f59cbff..c8529d004cfa37fef208afaa0e58a3774eaa082b 100644 (file)
@@ -469,7 +469,6 @@ void __init mem_init(void)
                        struct page *page = mem_map + pfn;
 
                        ClearPageReserved(page);
-                       set_bit(PG_highmem, &page->flags);
                        set_page_count(page, 1);
                        __free_page(page);
                        totalhigh_pages++;
index a2dea69b2f072a1dcaa55674abb7cf22b4e1449f..ec2e05028a10d7ff7804ef912833942e1e0fd20a 100644 (file)
@@ -384,7 +384,6 @@ void map_high_region(unsigned long start_pfn, unsigned long end_pfn)
                struct page *page = pfn_to_page(tmp);
 
                ClearPageReserved(page);
-               set_bit(PG_highmem, &page->flags);
                set_page_count(page, 1);
                __free_page(page);
                totalhigh_pages++;
index c22825f13e40fda8ab8a2b21d8cc5df6fc04f6d4..5597bd39e6b54a9f9d93ac914327c5eb1fb264ed 100644 (file)
@@ -53,7 +53,6 @@ static void setup_highmem(unsigned long highmem_start,
        for(i = 0; i < highmem_len >> PAGE_SHIFT; i++){
                page = &mem_map[highmem_pfn + i];
                ClearPageReserved(page);
-               set_bit(PG_highmem, &page->flags);
                set_page_count(page, 1);
                __free_page(page);
        }
index 39ab8c6b5652edefe8a85559692dac1395c7b8fe..df313891db109a7d322ec7ae68e0799f43cc9e93 100644 (file)
 #define PG_active               6
 #define PG_slab                         7      /* slab debug (Suparna wants this) */
 
-#define PG_highmem              8
-#define PG_checked              9      /* kill me in 2.5.<early>. */
-#define PG_arch_1              10
-#define PG_reserved            11
-
-#define PG_private             12      /* Has something at ->private */
-#define PG_writeback           13      /* Page is under writeback */
-#define PG_nosave              14      /* Used for system suspend/resume */
-#define PG_compound            15      /* Part of a compound page */
-
-#define PG_swapcache           16      /* Swap page: swp_entry_t in private */
-#define PG_mappedtodisk                17      /* Has blocks allocated on-disk */
-#define PG_reclaim             18      /* To be reclaimed asap */
-#define PG_nosave_free         19      /* Free, should not be written */
-#define PG_uncached            20      /* Page has been mapped as uncached */
+#define PG_checked              8      /* kill me in 2.5.<early>. */
+#define PG_arch_1               9
+#define PG_reserved            10
+#define PG_private             11      /* Has something at ->private */
+
+#define PG_writeback           12      /* Page is under writeback */
+#define PG_nosave              13      /* Used for system suspend/resume */
+#define PG_compound            14      /* Part of a compound page */
+#define PG_swapcache           15      /* Swap page: swp_entry_t in private */
+
+#define PG_mappedtodisk                16      /* Has blocks allocated on-disk */
+#define PG_reclaim             17      /* To be reclaimed asap */
+#define PG_nosave_free         18      /* Free, should not be written */
+#define PG_uncached            19      /* Page has been mapped as uncached */
 
 /*
  * Global page accounting.  One instance per CPU.  Only unsigned longs are
@@ -215,7 +214,7 @@ extern void __mod_page_state(unsigned offset, unsigned long delta);
 #define TestSetPageSlab(page)  test_and_set_bit(PG_slab, &(page)->flags)
 
 #ifdef CONFIG_HIGHMEM
-#define PageHighMem(page)      test_bit(PG_highmem, &(page)->flags)
+#define PageHighMem(page)      is_highmem(page_zone(page))
 #else
 #define PageHighMem(page)      0 /* needed to optimize away at compile time */
 #endif