From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: linux-ia64@vger.kernel.org
Subject: [RFC] [PATCH] naming reserved pages and remove PG_uncached [3/3]
Date: Thu, 28 Apr 2005 08:22:02 +0000 [thread overview]
Message-ID: <42709D2A.7090901@jp.fujitsu.com> (raw)
In-Reply-To: <42709BDD.3040805@jp.fujitsu.com>
[-- Attachment #1: Type: text/plain, Size: 29 bytes --]
removing PG_uncached
-- Kame
[-- Attachment #2: uncached_rsvd_page.patch --]
[-- Type: text/plain, Size: 3353 bytes --]
Now, PG_uncached is used to remember that a page is uncached.
PG_uncached pages is not freed or allocated while it is uncached.
So, PageReserved(page) && ( page->private = reserved_uncached)
can work enough, I think.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
linux-2.6.12-rc2-mm3-kamezawa/include/asm-ia64/uaccess.h | 4 +-
linux-2.6.12-rc2-mm3-kamezawa/include/linux/mm.h | 21 ++++++++++++---
linux-2.6.12-rc2-mm3-kamezawa/include/linux/page-flags.h | 3 --
3 files changed, 20 insertions(+), 8 deletions(-)
diff -puN include/linux/mm.h~uncached_rsvd_page include/linux/mm.h
--- linux-2.6.12-rc2-mm3/include/linux/mm.h~uncached_rsvd_page 2005-04-28 16:28:58.000000000 +0900
+++ linux-2.6.12-rc2-mm3-kamezawa/include/linux/mm.h 2005-04-28 16:28:58.000000000 +0900
@@ -358,10 +358,11 @@ static inline void put_page(struct page
*/
enum page_type {
page_common = 0,
- reserved_unknown = 1,
- reserved_at_boot,
+ page_reserved_unknown = 1,
+ page_reserved_at_boot,
+ page_reserved_uncached,
max_reserved_types,
- invalid_page_type = 0xff,
+ page_invalid_type = 0xff,
};
/*
@@ -376,6 +377,12 @@ static inline void set_page_reserved(str
page->private = (unsigned long)type;
}
+static inline void clear_page_reserved(struct page *page)
+{
+ page->private = 0;
+ ClearPageReserved(page);
+}
+
static inline unsigned char reserved_page_type(struct page *page)
{
if (!PageReserved(page))
@@ -383,6 +390,14 @@ static inline unsigned char reserved_pag
return (unsigned char) page->private;
}
+#define set_page_uncached(page) \
+ set_page_reserved((page), page_reserved_uncached)
+#define clr_page_uncahced(page)\
+ clear_page_reserved(page);
+#define page_is_uncached(page)\
+ (reserved_page_type(page) == page_reserved_uncached)
+
+
/*
* Multiple processes may "see" the same page. E.g. for untouched
* mappings of /dev/null, all processes see the same page full of
diff -puN include/linux/page-flags.h~uncached_rsvd_page include/linux/page-flags.h
--- linux-2.6.12-rc2-mm3/include/linux/page-flags.h~uncached_rsvd_page 2005-04-28 16:28:58.000000000 +0900
+++ linux-2.6.12-rc2-mm3-kamezawa/include/linux/page-flags.h 2005-04-28 16:28:58.000000000 +0900
@@ -302,9 +302,6 @@ extern void __mod_page_state(unsigned of
#define PageSwapCache(page) 0
#endif
-#define PageUncached(page) test_bit(PG_uncached, &(page)->flags)
-#define SetPageUncached(page) set_bit(PG_uncached, &(page)->flags)
-#define ClearPageUncached(page) clear_bit(PG_uncached, &(page)->flags)
struct page; /* forward declaration */
diff -puN include/asm-ia64/uaccess.h~uncached_rsvd_page include/asm-ia64/uaccess.h
--- linux-2.6.12-rc2-mm3/include/asm-ia64/uaccess.h~uncached_rsvd_page 2005-04-28 16:28:58.000000000 +0900
+++ linux-2.6.12-rc2-mm3-kamezawa/include/asm-ia64/uaccess.h 2005-04-28 16:28:58.000000000 +0900
@@ -379,7 +379,7 @@ xlate_dev_mem_ptr (unsigned long p)
char * ptr;
page = pfn_to_page(p >> PAGE_SHIFT);
- if (PageUncached(page))
+ if (page_is_uncached(page))
ptr = (char *)p + __IA64_UNCACHED_OFFSET;
else
ptr = __va(p);
@@ -397,7 +397,7 @@ xlate_dev_kmem_ptr (char * p)
char * ptr;
page = virt_to_page((unsigned long)p >> PAGE_SHIFT);
- if (PageUncached(page))
+ if (page_is_uncached(page))
ptr = (char *)__pa(p) + __IA64_UNCACHED_OFFSET;
else
ptr = p;
_
next prev parent reply other threads:[~2005-04-28 8:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-28 8:16 [RFC] [PATCH] naming reserved pages and remove PG_uncached [0/3] KAMEZAWA Hiroyuki
2005-04-28 8:19 ` [RFC] [PATCH] naming reserved pages and remove PG_uncached [1/3] KAMEZAWA Hiroyuki
2005-04-28 8:20 ` [RFC] [PATCH] naming reserved pages and remove PG_uncached [2/3] KAMEZAWA Hiroyuki
2005-04-28 8:22 ` KAMEZAWA Hiroyuki [this message]
2005-04-28 8:24 ` [RFC] [PATCH] naming reserved pages and remove PG_uncached Andrew Morton
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=42709D2A.7090901@jp.fujitsu.com \
--to=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-ia64@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.