Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755929AbYG3D0k (ORCPT ); Tue, 29 Jul 2008 23:26:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752002AbYG3D0a (ORCPT ); Tue, 29 Jul 2008 23:26:30 -0400 Received: from fgwmail7.fujitsu.co.jp ([192.51.44.37]:33575 "EHLO fgwmail7.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752644AbYG3D03 (ORCPT ); Tue, 29 Jul 2008 23:26:29 -0400 Date: Wed, 30 Jul 2008 12:16:52 +0900 From: Yasunori Goto To: Gerald Schaefer Subject: Re: memory hotplug: hot-remove fails on lowest chunk in ZONE_MOVABLE Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, KAMEZAWA Hiroyuki , Dave Hansen , Andy Whitcroft , Christoph Lameter , Nick Piggin , Peter Zijlstra In-Reply-To: <1217347653.4829.17.camel@localhost.localdomain> References: <20080723105318.81BC.E1E9C6FF@jp.fujitsu.com> <1217347653.4829.17.camel@localhost.localdomain> X-Mailer-Plugin: BkASPil for Becky!2 Ver.2.068 Message-Id: <20080730110444.27DE.E1E9C6FF@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.45 [ja] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3194 Lines: 74 > On Wed, 2008-07-23 at 11:48 +0900, Yasunori Goto wrote: > > > Memory hot-remove of the lowest memory chunk in ZONE_MOVABLE will fail > > > because of some reserved pages at the beginning of each zone > > > (MIGRATE_RESERVED). > > > > > I believe you are right. Current hot-remove code is NOT perfect. > > You may remove some sections, but may not other sections, > > because there are some un-removable pages by some reasons > > (not only MIGRATE_RESERVED). > > > > I think MIGRATE_RESERVED pages should be move to MIGRATE_MOVABLE when > > those pages must be removed, and should recalculate MIGRATE_RESERVED pages. > > Hi, > > Would it be an option to set pages_min to 0 for ZONE_MOVABLE in > setup_per_zone_pages_min()? This would avoid the MIGRATE_RESERVED vs. > MIGRATE_MOVABLE conflict on memory hot-remove. If I understand it > correctly, the kernel wouldn't be able to use the reserved pages in > ZONE_MOVABLE for __GFP_HIGH and PF_MEMALLOC allocations anyway, right? > > At the moment, ZONE_MOVABLE pages will also account for the lowmem_pages > calculation in setup_per_zone_pages_min(). The recalculation will then > redistribute and reduce the amount of reserved pages for the other zones. > Won't this effectively reduce the amount of reserved min_free_kbytes memory > that is available to the kernel, even getting worse the more memory is > added to ZONE_MOVABLE? > > With the following patch, ZONE_MOVABLE will be skipped for the > lowmem_pages calculation, just like it is already done for highmem. > It will also set pages_min to 0 for ZONE_MOVABLE. But I have an uneasy > feeling about this, because I may be missing side effects from this. > Any opinions? Well, I didn't mean changing pages_min value. There may be side effect as you are saying. I meant if some pages were MIGRATE_RESERVE attribute when hot-remove are -executing-, their attribute should be changed. For example, how is like following dummy code? Is it impossible? (Not only here, some places will have to be modified..) Thanks. --- mm/page_alloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: current/mm/page_alloc.c =================================================================== --- current.orig/mm/page_alloc.c 2008-07-29 22:17:54.000000000 +0900 +++ current/mm/page_alloc.c 2008-07-30 12:04:03.000000000 +0900 @@ -4828,7 +4828,9 @@ int set_migratetype_isolate(struct page /* * In future, more migrate types will be able to be isolation target. */ - if (get_pageblock_migratetype(page) != MIGRATE_MOVABLE) + if ((get_pageblock_migratetype(page) != MIGRATE_MOVABLE) || + !((removing section is the last section on the zone) && + get_pageblock_migratetype(page) == MIGRATE_RESREVE)) goto out; set_pageblock_migratetype(page, MIGRATE_ISOLATE); move_freepages_block(zone, page, MIGRATE_ISOLATE); -- Yasunori Goto -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/