2008-03-01 04:09:13

by Christoph Lameter

[permalink] [raw]
Subject: [rfc 04/10] Pageflags: Eliminate PG_readahead

PG_readahead is an alias of PG_reclaim. We can easily drop that now and
alias by specifying PG_reclaim in the macro that generates the functions
for PageReadahead().

Signed-off-by: Christoph Lameter <[email protected]>

---
include/linux/page-flags.h | 4 +---
mm/page_alloc.c | 2 +-
2 files changed, 2 insertions(+), 4 deletions(-)

Index: linux-2.6/mm/page_alloc.c
===================================================================
--- linux-2.6.orig/mm/page_alloc.c 2008-02-29 19:13:56.000000000 -0800
+++ linux-2.6/mm/page_alloc.c 2008-02-29 19:20:11.000000000 -0800
@@ -623,7 +623,7 @@ static int prep_new_page(struct page *pa
if (PageReserved(page))
return 1;

- page->flags &= ~(1 << PG_uptodate | 1 << PG_error | 1 << PG_readahead |
+ page->flags &= ~(1 << PG_uptodate | 1 << PG_error | 1 << PG_reclaim |
1 << PG_referenced | 1 << PG_arch_1 |
1 << PG_owner_priv_1 | 1 << PG_mappedtodisk);
set_page_private(page, 0);
Index: linux-2.6/include/linux/page-flags.h
===================================================================
--- linux-2.6.orig/include/linux/page-flags.h 2008-02-29 19:20:03.000000000 -0800
+++ linux-2.6/include/linux/page-flags.h 2008-02-29 19:20:11.000000000 -0800
@@ -85,8 +85,6 @@ enum pageflags {
PG_swapcache, /* Swap page: swp_entry_t in private */
PG_mappedtodisk, /* Has blocks allocated on-disk */
PG_reclaim, /* To be reclaimed asap */
- /* PG_readahead is only used for file reads; PG_reclaim is only for writes */
- PG_readahead = PG_reclaim, /* Reminder to do async read-ahead */
PG_buddy, /* Page is free, on buddy lists */
NR_PAGEFLAGS, /* For verification purposes */

@@ -168,7 +166,7 @@ PAGEFLAG(MappedToDisk, mappedtodisk)

/* PG_readahead is only used for file reads; PG_reclaim is only for writes */
PAGEFLAG(Reclaim, reclaim) TESTCLEARFLAG(Reclaim, reclaim)
-PAGEFLAG(Readahead, readahead) /* Reminder to do async read-ahead */
+PAGEFLAG(Readahead, reclaim) /* Reminder to do async read-ahead */

#ifdef CONFIG_HIGHMEM
#define PageHighMem(page) is_highmem(page_zone(page))

--