From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933093Ab2GCDdq (ORCPT ); Mon, 2 Jul 2012 23:33:46 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:59421 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932139Ab2GCDdp (ORCPT ); Mon, 2 Jul 2012 23:33:45 -0400 Message-ID: <4FF26726.8010904@huawei.com> Date: Tue, 3 Jul 2012 11:29:42 +0800 From: Jiang Liu User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Yinghai Lu CC: Benjamin Herrenschmidt , Andrew Morton , Mel Gorman , Tony Luck , Xishi Qiu , KAMEZAWA Hiroyuki , KOSAKI Motohiro , David Rientjes , Minchan Kim , Keping Chen , , , , Jiang Liu , David Gibson , Subject: Re: [PATCH] mm: setup pageblock_order before it's used by sparse References: <1341047274-5616-1-git-send-email-jiang.liu@huawei.com> <4FF100F0.9050501@huawei.com> <4FF25EFA.1080004@huawei.com> In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.108.108.229] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> Hi Yinghai, >> >> I'm afraid the v2 will break powerpc. Currently only IA64 and PowerPC >> supports variable hugetlb size. >> >> HPAGE_SHIFT is a variable default to 0 on powerpc. But seems PowerPC >> is doing something wrong here, according to it's mm initialization >> sequence as below: >> start_kernel() >> setup_arch() >> paging_init() >> free_area_init_node() >> set_pageblock_order() >> refer to HPAGE_SHIFT (still 0) >> init_rest() >> do_initcalls() >> hugetlbpage_init() >> setup HPAGE_SHIFT >> That means pageblock_order is always set to "MAX_ORDER - 1", not sure >> whether this is intended. And it has the same issue as IA64 of wasting >> memory if CONFIG_SPARSE is enabled. > > adding BenH, need to know if it is powerpc intended. > >> >> So it would be better to keep function set_pageblock_order(), it will >> fix the memory wasting on both IA64 and PowerPC. > > Should setup pageblock_order as early as possible to avoid confusing. OK, waiting response from PPC. If we could find some ways to set HPAGE_SIZE early on PPC too, we can setup pageblock_order in arch instead of page_alloc.c as early as possible. Thanks! Gerry