From: Yasunori Goto <y-goto@jp.fujitsu.com>
To: linux-mm <linux-mm@kvack.org>,
Linux Hotplug Memory Support <lhms-devel@lists.sourceforge.net>
Cc: Joel Schopp <jschopp@austin.ibm.com>
Subject: [Patch] New zone ZONE_EASY_RECLAIM take 3. (is_easy_reclaim func)[4/5]
Date: Sat, 10 Dec 2005 20:03:01 +0900 [thread overview]
Message-ID: <20051210194128.482C.Y-GOTO@jp.fujitsu.com> (raw)
This is for calculation of the watermark zone->pages_min/low/high.
And it defines is_higher_zone().
Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>
Index: zone_reclaim/include/linux/mmzone.h
===================================================================
--- zone_reclaim.orig/include/linux/mmzone.h 2005-12-10 17:13:16.000000000 +0900
+++ zone_reclaim/include/linux/mmzone.h 2005-12-10 17:39:57.000000000 +0900
@@ -394,6 +394,11 @@ static inline int populated_zone(struct
return (!!zone->present_pages);
}
+static inline int is_easy_reclaim_idx(int idx)
+{
+ return (idx == ZONE_EASY_RECLAIM);
+}
+
static inline int is_highmem_idx(int idx)
{
return (idx == ZONE_HIGHMEM);
@@ -410,11 +415,21 @@ static inline int is_normal_idx(int idx)
* to ZONE_{DMA/NORMAL/HIGHMEM/etc} in general code to a minimum.
* @zone - pointer to struct zone variable
*/
+static inline int is_easy_reclaim(struct zone *zone)
+{
+ return zone == zone->zone_pgdat->node_zones + ZONE_EASY_RECLAIM;
+}
+
static inline int is_highmem(struct zone *zone)
{
return zone == zone->zone_pgdat->node_zones + ZONE_HIGHMEM;
}
+static inline int is_higher_zone(struct zone *zone)
+{
+ return (is_highmem(zone) || is_easy_reclaim(zone));
+}
+
static inline int is_normal(struct zone *zone)
{
return zone == zone->zone_pgdat->node_zones + ZONE_NORMAL;
Index: zone_reclaim/mm/page_alloc.c
===================================================================
--- zone_reclaim.orig/mm/page_alloc.c 2005-12-10 17:15:10.000000000 +0900
+++ zone_reclaim/mm/page_alloc.c 2005-12-10 17:40:59.000000000 +0900
@@ -2573,7 +2573,7 @@ void setup_per_zone_pages_min(void)
/* Calculate total number of !ZONE_HIGHMEM pages */
for_each_zone(zone) {
- if (!is_highmem(zone))
+ if (!is_higher_zone(zone))
lowmem_pages += zone->present_pages;
}
@@ -2581,7 +2581,7 @@ void setup_per_zone_pages_min(void)
unsigned long tmp;
spin_lock_irqsave(&zone->lru_lock, flags);
tmp = (pages_min * zone->present_pages) / lowmem_pages;
- if (is_highmem(zone)) {
+ if (is_higher_zone(zone)) {
/*
* __GFP_HIGH and PF_MEMALLOC allocations usually don't
* need highmem pages, so cap pages_min to a small
--
Yasunori Goto
--
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:"dont@kvack.org"> email@kvack.org </a>
reply other threads:[~2005-12-10 11:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20051210194128.482C.Y-GOTO@jp.fujitsu.com \
--to=y-goto@jp.fujitsu.com \
--cc=jschopp@austin.ibm.com \
--cc=lhms-devel@lists.sourceforge.net \
--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