From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: linux-ia64@vger.kernel.org
Subject: [RFC] [PATCH] naming reserved pages and remove PG_uncached [1/3]
Date: Thu, 28 Apr 2005 08:19:12 +0000 [thread overview]
Message-ID: <42709C80.6030607@jp.fujitsu.com> (raw)
In-Reply-To: <42709BDD.3040805@jp.fujitsu.com>
[-- Attachment #1: Type: text/plain, Size: 52 bytes --]
inline functions for naming reserved pages.
-- Kame
[-- Attachment #2: name_reserved.patch --]
[-- Type: text/plain, Size: 2111 bytes --]
This patch add additonal information to 'Reserved' pages.
Information is stored in page->private.
Now, PG_reserved is used for many purpose and we cannot find
why it is reserved easily.
I'm now thinking of distinguishing
a) Memory Hole
b) isolated by MCA
c) Reserved by drivers
d) others
,which are all "Reserved".
Further more investigation will be needed.
By the way there are two way to isolate pages,
(i) set PG_reserved
(ii) allocate and never free.
Using (i) and setting page->private correctly looks clearer way and
wiil help memory-hotplug (and other stuffs).
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
---
linux-2.6.12-rc2-mm3-kamezawa/include/linux/mm.h | 31 +++++++++++++++++++++++
1 files changed, 31 insertions(+)
diff -puN include/linux/mm.h~name_reserved include/linux/mm.h
--- linux-2.6.12-rc2-mm3/include/linux/mm.h~name_reserved 2005-04-28 15:11:23.000000000 +0900
+++ linux-2.6.12-rc2-mm3-kamezawa/include/linux/mm.h 2005-04-28 16:28:41.000000000 +0900
@@ -353,6 +353,37 @@ static inline void put_page(struct page
#endif /* CONFIG_HUGETLB_PAGE */
/*
+ * types of pages
+ * value range is 0-255.
+ */
+enum page_type {
+ page_common = 0,
+ reserved_unknown = 1,
+ reserved_at_boot,
+ max_reserved_types,
+ invalid_page_type = 0xff,
+};
+
+/*
+ * Basically, page->private has no meaning without PG_private.
+ * Here, we use page->private for PG_reserved pages to record a type of a page.
+ * Because a page is reserved, anyone will not modify page->private.
+ * When it is freed, page->private will be overwritten by some code.
+ */
+static inline void set_page_reserved(struct page *page, enum page_type type)
+{
+ SetPageReserved(page);
+ page->private = (unsigned long)type;
+}
+
+static inline unsigned char reserved_page_type(struct page *page)
+{
+ if (!PageReserved(page))
+ return 0;
+ return (unsigned char) page->private;
+}
+
+/*
* Multiple processes may "see" the same page. E.g. for untouched
* mappings of /dev/null, all processes see the same page full of
* zeroes, and text pages of executables and shared libraries have
_
next prev parent reply other threads:[~2005-04-28 8:19 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 ` KAMEZAWA Hiroyuki [this message]
2005-04-28 8:20 ` [RFC] [PATCH] naming reserved pages and remove PG_uncached [2/3] KAMEZAWA Hiroyuki
2005-04-28 8:22 ` [RFC] [PATCH] naming reserved pages and remove PG_uncached [3/3] KAMEZAWA Hiroyuki
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=42709C80.6030607@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox