Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932688AbbFIGzd (ORCPT ); Tue, 9 Jun 2015 02:55:33 -0400 Received: from mgwkm04.jp.fujitsu.com ([202.219.69.171]:26089 "EHLO mgwkm04.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752512AbbFIGzZ (ORCPT ); Tue, 9 Jun 2015 02:55:25 -0400 X-SecurityPolicyCheck: OK by SHieldMailChecker v2.3.2 X-SHieldMailCheckerPolicyVersion: FJ-ISEC-20150223 X-SHieldMailCheckerMailID: a1619db5c6494fab89da9b828902ad3b Message-ID: <55768DBD.9010203@jp.fujitsu.com> Date: Tue, 09 Jun 2015 15:54:53 +0900 From: Kamezawa Hiroyuki User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Xishi Qiu , Andrew Morton , nao.horiguchi@gmail.com, Yinghai Lu , "H. Peter Anvin" , Thomas Gleixner , mingo@elte.hu, Xiexiuqi , Hanjun Guo , "Luck, Tony" CC: Linux MM , LKML Subject: Re: [RFC PATCH 03/12] mm: introduce MIGRATE_MIRROR to manage the mirrored, pages References: <55704A7E.5030507@huawei.com> <55704B8C.7080506@huawei.com> In-Reply-To: <55704B8C.7080506@huawei.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 6394 Lines: 126 On 2015/06/04 21:58, Xishi Qiu wrote: > This patch introduces a new MIGRATE_TYPES called "MIGRATE_MIRROR", it is used > to storage the mirrored pages list. > When cat /proc/pagetypeinfo, you can see the count of free mirrored blocks. > I guess you need to add Mel to CC. > e.g. > euler-linux:~ # cat /proc/pagetypeinfo > Page block order: 9 > Pages per block: 512 > > Free pages count per migrate type at order 0 1 2 3 4 5 6 7 8 9 10 > Node 0, zone DMA, type Unmovable 1 1 0 0 2 1 1 0 1 0 0 > Node 0, zone DMA, type Reclaimable 0 0 0 0 0 0 0 0 0 0 0 > Node 0, zone DMA, type Movable 0 0 0 0 0 0 0 0 0 0 3 > Node 0, zone DMA, type Mirror 0 0 0 0 0 0 0 0 0 0 0 > Node 0, zone DMA, type Reserve 0 0 0 0 0 0 0 0 0 1 0 > Node 0, zone DMA, type Isolate 0 0 0 0 0 0 0 0 0 0 0 > Node 0, zone DMA32, type Unmovable 0 0 1 0 0 0 0 1 1 1 0 > Node 0, zone DMA32, type Reclaimable 0 0 0 0 0 0 0 0 0 0 0 > Node 0, zone DMA32, type Movable 1 2 6 6 6 4 5 3 3 2 738 > Node 0, zone DMA32, type Mirror 0 0 0 0 0 0 0 0 0 0 0 > Node 0, zone DMA32, type Reserve 0 0 0 0 0 0 0 0 0 0 1 > Node 0, zone DMA32, type Isolate 0 0 0 0 0 0 0 0 0 0 0 > Node 0, zone Normal, type Unmovable 0 0 0 0 0 0 0 0 0 0 0 > Node 0, zone Normal, type Reclaimable 0 0 0 0 0 0 0 0 0 0 0 > Node 0, zone Normal, type Movable 0 0 1 1 0 0 0 2 1 0 4254 > Node 0, zone Normal, type Mirror 148 104 63 70 26 11 2 2 1 1 973 > Node 0, zone Normal, type Reserve 0 0 0 0 0 0 0 0 0 0 1 > Node 0, zone Normal, type Isolate 0 0 0 0 0 0 0 0 0 0 0 > > Number of blocks type Unmovable Reclaimable Movable Mirror Reserve Isolate > Node 0, zone DMA 1 0 6 0 1 0 > Node 0, zone DMA32 2 0 1525 0 1 0 > Node 0, zone Normal 0 0 8702 2048 2 0 > Page block order: 9 > Pages per block: 512 > > Free pages count per migrate type at order 0 1 2 3 4 5 6 7 8 9 10 > Node 1, zone Normal, type Unmovable 0 0 0 0 0 0 0 0 0 0 0 > Node 1, zone Normal, type Reclaimable 0 0 0 0 0 0 0 0 0 0 0 > Node 1, zone Normal, type Movable 2 2 1 1 2 1 2 2 2 3 3996 > Node 1, zone Normal, type Mirror 68 94 57 6 8 1 0 0 3 1 2003 > Node 1, zone Normal, type Reserve 0 0 0 0 0 0 0 0 0 0 1 > Node 1, zone Normal, type Isolate 0 0 0 0 0 0 0 0 0 0 0 > > Number of blocks type Unmovable Reclaimable Movable Mirror Reserve Isolate > Node 1, zone Normal 0 0 8190 4096 2 0 > > > Signed-off-by: Xishi Qiu > --- > include/linux/mmzone.h | 6 ++++++ > mm/page_alloc.c | 3 +++ > mm/vmstat.c | 3 +++ > 3 files changed, 12 insertions(+) > > diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h > index 1fae07b..b444335 100644 > --- a/include/linux/mmzone.h > +++ b/include/linux/mmzone.h > @@ -39,6 +39,9 @@ enum { > MIGRATE_UNMOVABLE, > MIGRATE_RECLAIMABLE, > MIGRATE_MOVABLE, > +#ifdef CONFIG_MEMORY_MIRROR > + MIGRATE_MIRROR, > +#endif I can't imagine how the fallback logic will work at reading this patch. I think an update for fallback order array should be in this patch... > MIGRATE_PCPTYPES, /* the number of types on the pcp lists */ > MIGRATE_RESERVE = MIGRATE_PCPTYPES, > #ifdef CONFIG_CMA > @@ -82,6 +85,9 @@ struct mirror_info { > }; > > extern struct mirror_info mirror_info; > +# define is_migrate_mirror(migratetype) unlikely((migratetype) == MIGRATE_MIRROR) > +#else > +# define is_migrate_mirror(migratetype) false > #endif > > #define for_each_migratetype_order(order, type) \ > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 41a95a7..3b2ff46 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -3245,6 +3245,9 @@ static void show_migration_types(unsigned char type) > [MIGRATE_UNMOVABLE] = 'U', > [MIGRATE_RECLAIMABLE] = 'E', > [MIGRATE_MOVABLE] = 'M', > +#ifdef CONFIG_MEMORY_MIRROR > + [MIGRATE_MIRROR] = 'O', > +#endif > [MIGRATE_RESERVE] = 'R', > #ifdef CONFIG_CMA > [MIGRATE_CMA] = 'C', > diff --git a/mm/vmstat.c b/mm/vmstat.c > index 4f5cd97..d0323e0 100644 > --- a/mm/vmstat.c > +++ b/mm/vmstat.c > @@ -901,6 +901,9 @@ static char * const migratetype_names[MIGRATE_TYPES] = { > "Unmovable", > "Reclaimable", > "Movable", > +#ifdef CONFIG_MEMORY_MIRROR > + "Mirror", > +#endif > "Reserve", > #ifdef CONFIG_CMA > "CMA", > -- 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/