From: David Rientjes <rientjes@google.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: linux-mm@kvack.org, mel@skynet.ie, clameter@engr.sgi.com,
akpm@linux-foundation.org
Subject: Re: [RFC} memory unplug patchset prep [4/16] ZONE_MOVABLE
Date: Tue, 6 Mar 2007 08:06:33 -0800 (PST) [thread overview]
Message-ID: <Pine.LNX.4.64.0703060024440.21900@chino.kir.corp.google.com> (raw)
In-Reply-To: <20070306134549.174cc160.kamezawa.hiroyu@jp.fujitsu.com>
On Tue, 6 Mar 2007, KAMEZAWA Hiroyuki wrote:
> Index: devel-tree-2.6.20-mm2/include/linux/mmzone.h
> ===================================================================
> --- devel-tree-2.6.20-mm2.orig/include/linux/mmzone.h
> +++ devel-tree-2.6.20-mm2/include/linux/mmzone.h
> @@ -142,6 +142,16 @@ enum zone_type {
> */
> ZONE_HIGHMEM,
> #endif
> +#ifdef CONFIG_ZONE_MOVABLE
> + /*
> + * This memory area is used only for migratable pages.
> + * We have a chance to hot-remove memory in this zone.
> + * Currently, anonymous memory and usual page cache etc. are included.
> + * if HIGHMEM is configured, MOVABLE zone is treated as
> + * not-direct-mapped-memory for kernel;.
> + */
> + ZONE_MOVABLE,
> +#endif
> MAX_NR_ZONES,
> #ifndef CONFIG_ZONE_DMA
> ZONE_DMA,
> @@ -152,6 +162,9 @@ enum zone_type {
> #ifndef CONFIG_HIGHMEM
> ZONE_HIGHMEM,
> #endif
> +#ifndef CONFIG_ZONE_MOVABLE
> + ZONE_MOVABLE,
> +#endif
> MAX_POSSIBLE_ZONES
> };
>
> @@ -172,13 +185,18 @@ static inline int is_configured_zone(enu
> * Count the active zones. Note that the use of defined(X) outside
> * #if and family is not necessarily defined so ensure we cannot use
> * it later. Use __ZONE_COUNT to work out how many shift bits we need.
> + *
> + * Assumes ZONE_DMA32,ZONE_HIGHMEM, ZONE_MOVABLE can't be configured at
> + * the same time.
> */
> #define __ZONE_COUNT ( \
> defined(CONFIG_ZONE_DMA) \
> + defined(CONFIG_ZONE_DMA32) \
> + 1 \
> + defined(CONFIG_HIGHMEM) \
> + + defined(CONFIG_ZONE_MOVABLE) \
> )
> +
> #if __ZONE_COUNT < 2
> #define ZONES_SHIFT 0
> #elif __ZONE_COUNT <= 2
> @@ -513,6 +531,11 @@ static inline int populated_zone(struct
> return (!!zone->present_pages);
> }
>
> +static inline int is_movable_dix(enum zone_type idx)
> +{
> + return (idx == ZONE_MOVABLE);
> +}
> +
Should be is_movable_idx() maybe? I assume this function is here for
completeness since it's never referenced in the patchset.
> Index: devel-tree-2.6.20-mm2/mm/page_alloc.c
> ===================================================================
> --- devel-tree-2.6.20-mm2.orig/mm/page_alloc.c
> +++ devel-tree-2.6.20-mm2/mm/page_alloc.c
> @@ -82,6 +82,7 @@ static char name_dma[] = "DMA";
> static char name_dma32[] = "DMA32";
> static char name_normal[] = "Normal";
> static char name_highmem[] = "Highmem";
> +static char name_movable[] = "Movable";
>
> static inline void __meminit zone_variables_init(void)
> {
> @@ -91,6 +92,7 @@ static inline void __meminit zone_variab
> zone_names[ZONE_DMA32] = name_dma32;
> zone_names[ZONE_NORMAL] = name_normal;
> zone_names[ZONE_HIGHMEM] = name_highmem;
> + zone_names[ZONE_MOVABLE] = name_movable;
>
> /* ZONE below NORAML has ratio 256 */
> if (is_configured_zone(ZONE_DMA))
> @@ -99,6 +101,8 @@ static inline void __meminit zone_variab
> sysctl_lowmem_reserve_ratio[ZONE_DMA32] = 256;
> if (is_configured_zone(ZONE_HIGHMEM))
> sysctl_lowmem_reserve_ratio[ZONE_HIGHMEM] = 32;
> + if (is_configured_zone(ZONE_MOVABLE))
> + sysctl_lowmem_reserve_ratio[ZONE_MOVABLE] = 32;
> }
>
> int min_free_kbytes = 1024;
> @@ -3065,11 +3069,17 @@ void __init free_area_init_nodes(unsigne
> arch_zone_lowest_possible_pfn[0] = find_min_pfn_with_active_regions();
> arch_zone_highest_possible_pfn[0] = max_zone_pfn[0];
> for (i = 1; i < MAX_NR_ZONES; i++) {
> + if (i == ZONE_MOVABLE)
> + continue;
> arch_zone_lowest_possible_pfn[i] =
> arch_zone_highest_possible_pfn[i-1];
> arch_zone_highest_possible_pfn[i] =
> max(max_zone_pfn[i], arch_zone_lowest_possible_pfn[i]);
> }
> + if (is_configured_zone(ZONE_MOVABLE)) {
> + arch_zone_lowest_possible_pfn[ZONE_MOVABLE] = 0;
> + arch_zone_highest_possible_pfn[ZONE_MOVABLE] = 0;
> + }
>
> /* Print out the page size for debugging meminit problems */
> printk(KERN_DEBUG "sizeof(struct page) = %zd\n", sizeof(struct page));
Aren't the arch_zone_{lowest|highest}_possible_pfn's for ZONE_MOVABLE
already at 0? If not, it should definitely be memset early on to avoid
any possible assignment mistakes amongst all these conditionals.
> Index: devel-tree-2.6.20-mm2/mm/Kconfig
> ===================================================================
> --- devel-tree-2.6.20-mm2.orig/mm/Kconfig
> +++ devel-tree-2.6.20-mm2/mm/Kconfig
> @@ -163,6 +163,10 @@ config ZONE_DMA_FLAG
> default "0" if !ZONE_DMA
> default "1"
>
> +config ZONE_MOVABLE
> + bool "Create zones for MOVABLE pages"
> + depends on ARCH_POPULATES_NODE_MAP
> + depends on MIGRATION
> #
> # Adaptive file readahead
> #
>
This patchset is heavily dependent on Mel Gorman's work with ZONE_MOVABLE
so perhaps it would be better to base it off of the latest -mm with his
patchset applied? And if CONFIG_ZONE_MOVABLE wasn't documented in Kconfig
prior to this, it might be a good opportunity to do so if you're going to
get community adoption.
David
--
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>
next prev parent reply other threads:[~2007-03-06 16:06 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-06 4:32 [RFC} memory unplug patchset prep [0/16] KAMEZAWA Hiroyuki
2007-03-06 4:42 ` [RFC} memory unplug patchset prep [1/16] zone ids cleanup KAMEZAWA Hiroyuki
2007-03-06 15:36 ` David Rientjes
2007-03-07 1:21 ` KAMEZAWA Hiroyuki
2007-03-06 4:43 ` [RFC} memory unplug patchset prep [2/16] gathering alloc_zeroed_user_highpage() KAMEZAWA Hiroyuki
2007-03-06 15:54 ` David Rientjes
2007-03-07 1:46 ` KAMEZAWA Hiroyuki
2007-03-06 4:44 ` [RFC} memory unplug patchset prep [3/16] define is_identity_mapped KAMEZAWA Hiroyuki
2007-03-06 15:55 ` David Rientjes
2007-03-07 1:48 ` KAMEZAWA Hiroyuki
2007-03-06 4:45 ` [RFC} memory unplug patchset prep [4/16] ZONE_MOVABLE KAMEZAWA Hiroyuki
2007-03-06 16:06 ` David Rientjes [this message]
2007-03-07 1:51 ` KAMEZAWA Hiroyuki
2007-03-06 4:47 ` [RFC} memory unplug patchset prep [5/16] GFP_MOVABLE KAMEZAWA Hiroyuki
2007-03-06 4:48 ` [RFC} memory unplug patchset prep [6/16] alloc_zeroed_user_high_movable KAMEZAWA Hiroyuki
2007-03-06 4:49 ` [RFC} memory unplug patchset prep [7/16] change caller's gfp_mask KAMEZAWA Hiroyuki
2007-03-06 4:50 ` [RFC} memory unplug patchset prep [8/16] counter for ZONE_MOVABLE KAMEZAWA Hiroyuki
2007-03-06 16:11 ` David Rientjes
2007-03-07 1:55 ` KAMEZAWA Hiroyuki
2007-03-06 4:52 ` [RFC} memory unplug patchset prep [9/16] create movable zone at boot KAMEZAWA Hiroyuki
2007-03-06 16:06 ` David Rientjes
2007-03-07 2:02 ` KAMEZAWA Hiroyuki
2007-03-06 4:53 ` [RFC} memory unplug patchset prep [10/16] ia64 support KAMEZAWA Hiroyuki
2007-03-06 4:55 ` [RFC} memory unplug patchset prep [11/16] page isolation core KAMEZAWA Hiroyuki
2007-03-06 4:56 ` [RFC} memory unplug patchset prep [12/16] drain all pages KAMEZAWA Hiroyuki
2007-03-06 4:57 ` [RFC} memory unplug patchset prep [13/16] isolate freed pages KAMEZAWA Hiroyuki
2007-03-06 4:59 ` [RFC} memory unplug patchset prep [14/16] memory unplug core KAMEZAWA Hiroyuki
2007-03-06 5:00 ` [RFC} memory unplug patchset prep [15/16] hot-unplug interface for ia64 KAMEZAWA Hiroyuki
2007-03-06 5:02 ` [RFC} memory unplug patchset prep [16/16] migration nocontext KAMEZAWA Hiroyuki
2007-03-06 15:24 ` [RFC} memory unplug patchset prep [0/16] David Rientjes
2007-03-07 2:24 ` KAMEZAWA Hiroyuki
2007-03-07 2:31 ` David Rientjes
2007-03-07 2:44 ` KAMEZAWA Hiroyuki
2007-03-07 19:44 ` Mark Gross
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=Pine.LNX.4.64.0703060024440.21900@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=clameter@engr.sgi.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=mel@skynet.ie \
/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