Skip to content

Commit

Permalink
[PATCH] mm: remove PG_highmem
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Badari Pulavarty authored and Linus Torvalds committed Jun 22, 2005
1 parent 73219d1 commit cbe37d0
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 22 deletions.
1 change: 0 additions & 1 deletion arch/frv/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
1 change: 0 additions & 1 deletion arch/i386/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
1 change: 0 additions & 1 deletion arch/mips/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
1 change: 0 additions & 1 deletion arch/ppc/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
1 change: 0 additions & 1 deletion arch/sparc/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
1 change: 0 additions & 1 deletion arch/um/kernel/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
31 changes: 15 additions & 16 deletions include/linux/page-flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,20 @@
#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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cbe37d0

Please sign in to comment.