From: Matthew Wilcox <matthew@wil.cx>
To: linux-mm@kvack.org
Cc: Andrew Morton <akpm@zip.com.au>
Subject: [PATCH] Neaten page virtual choice
Date: Thu, 2 Dec 2004 16:26:21 +0000 [thread overview]
Message-ID: <20041202162621.GM5752@parcelfarce.linux.theplanet.co.uk> (raw)
Make it more obvious that WANT_PAGE_VIRTUAL/HASHED_PAGE_VIRTUAL/!HIGHMEM
is a three way choice.
Index: linux/include/linux/mm.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/linux/mm.h,v
retrieving revision 1.22
diff -u -p -r1.22 mm.h
--- linux/include/linux/mm.h 29 Nov 2004 19:56:48 -0000 1.22
+++ linux/include/linux/mm.h 1 Dec 2004 20:53:38 -0000
@@ -414,29 +414,22 @@ static inline void *lowmem_page_address(
return __va(page_to_pfn(page) << PAGE_SHIFT);
}
-#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL)
-#define HASHED_PAGE_VIRTUAL
-#endif
-
#if defined(WANT_PAGE_VIRTUAL)
-#define page_address(page) ((page)->virtual)
-#define set_page_address(page, address) \
+ #define page_address(page) ((page)->virtual)
+ #define set_page_address(page, address) \
do { \
(page)->virtual = (address); \
} while(0)
-#define page_address_init() do { } while(0)
-#endif
-
-#if defined(HASHED_PAGE_VIRTUAL)
-void *page_address(struct page *page);
-void set_page_address(struct page *page, void *virtual);
-void page_address_init(void);
-#endif
-
-#if !defined(HASHED_PAGE_VIRTUAL) && !defined(WANT_PAGE_VIRTUAL)
-#define page_address(page) lowmem_page_address(page)
-#define set_page_address(page, address) do { } while(0)
-#define page_address_init() do { } while(0)
+ #define page_address_init() do { } while(0)
+#elif defined(CONFIG_HIGHMEM)
+ #define HASHED_PAGE_VIRTUAL
+ void *page_address(struct page *page);
+ void set_page_address(struct page *page, void *virtual);
+ void page_address_init(void);
+#else
+ #define page_address(page) lowmem_page_address(page)
+ #define set_page_address(page, address) do { } while(0)
+ #define page_address_init() do { } while(0)
#endif
/*
Index: linux/mm/highmem.c
===================================================================
RCS file: /var/cvs/linux-2.6/mm/highmem.c,v
retrieving revision 1.8
diff -u -p -r1.8 highmem.c
--- linux/mm/highmem.c 30 Sep 2004 12:08:53 -0000 1.8
+++ linux/mm/highmem.c 1 Dec 2004 21:49:21 -0000
@@ -483,7 +483,7 @@ void blk_queue_bounce(request_queue_t *q
EXPORT_SYMBOL(blk_queue_bounce);
-#if defined(HASHED_PAGE_VIRTUAL)
+#ifdef HASHED_PAGE_VIRTUAL
#define PA_HASH_ORDER 7
@@ -602,4 +602,4 @@ void __init page_address_init(void)
spin_lock_init(&pool_lock);
}
-#endif /* defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) */
+#endif /* HASHED_PAGE_VIRTUAL */
--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
next reply other threads:[~2004-12-02 16:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-02 16:26 Matthew Wilcox [this message]
2004-12-02 18:35 ` Christoph Hellwig
2004-12-02 18:42 ` Martin J. Bligh
2004-12-02 19:12 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041202162621.GM5752@parcelfarce.linux.theplanet.co.uk \
--to=matthew@wil.cx \
--cc=akpm@zip.com.au \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox