[PATCH] mm: remove PG_highmem
Badari Pulavarty [Wed, 22 Jun 2005 00:14:52 +0000 (17:14 -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 41958f5..7943315 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 7a7ea37..8766c77 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 b027ce7..73843c5 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 363c157..c8529d0 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 a2dea69..ec2e050 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 c22825f..5597bd3 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 39ab8c6..df31389 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