From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933017Ab2GCC7m (ORCPT ); Mon, 2 Jul 2012 22:59:42 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:57092 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755857Ab2GCC7l (ORCPT ); Mon, 2 Jul 2012 22:59:41 -0400 Message-ID: <4FF25EFA.1080004@huawei.com> Date: Tue, 3 Jul 2012 10:54:50 +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: 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> In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit 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 On 2012-7-3 4:43, Yinghai Lu wrote: > On Sun, Jul 1, 2012 at 7:01 PM, Jiang Liu wrote: >> Hi Yinghai, >> The patch fails compilation as below: >> mm/page_alloc.c:151: error: initializer element is not constant >> mm/page_alloc.c:151: error: expected ‘,’ or ‘;’ before ‘__attribute__’ >> >> On IA64, HUGETLB_PAGE_ORDER has dependency on variable hpage_shift. >> # define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) >> # define HPAGE_SHIFT hpage_shift >> >> And hpage_shift could be changed by early parameter "hugepagesz". >> So seems will still need to keep function set_pageblock_order(). > > ah, then use use _DEFAULT instead and later could update that in earlyparam. > > So attached -v2 should work. 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. So it would be better to keep function set_pageblock_order(), it will fix the memory wasting on both IA64 and PowerPC. Thanks! Gerry > > Thanks > > Yinghai From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <4FF25EFA.1080004@huawei.com> Date: Tue, 3 Jul 2012 10:54:50 +0800 From: Jiang Liu MIME-Version: 1.0 To: Yinghai Lu CC: 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> In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: On 2012-7-3 4:43, Yinghai Lu wrote: > On Sun, Jul 1, 2012 at 7:01 PM, Jiang Liu wrote: >> Hi Yinghai, >> The patch fails compilation as below: >> mm/page_alloc.c:151: error: initializer element is not constant >> mm/page_alloc.c:151: error: expected �,� or �;� before �__attribute__� >> >> On IA64, HUGETLB_PAGE_ORDER has dependency on variable hpage_shift. >> # define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) >> # define HPAGE_SHIFT hpage_shift >> >> And hpage_shift could be changed by early parameter "hugepagesz". >> So seems will still need to keep function set_pageblock_order(). > > ah, then use use _DEFAULT instead and later could update that in earlyparam. > > So attached -v2 should work. 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. So it would be better to keep function set_pageblock_order(), it will fix the memory wasting on both IA64 and PowerPC. Thanks! Gerry > > Thanks > > Yinghai From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx111.postini.com [74.125.245.111]) by kanga.kvack.org (Postfix) with SMTP id 8699D6B0070 for ; Mon, 2 Jul 2012 22:59:35 -0400 (EDT) Message-ID: <4FF25EFA.1080004@huawei.com> Date: Tue, 3 Jul 2012 10:54:50 +0800 From: Jiang Liu MIME-Version: 1.0 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> In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 8bit Sender: owner-linux-mm@kvack.org List-ID: To: Yinghai Lu Cc: Andrew Morton , Mel Gorman , Tony Luck , Xishi Qiu , KAMEZAWA Hiroyuki , KOSAKI Motohiro , David Rientjes , Minchan Kim , Keping Chen , linux-mm@kvack.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org, Jiang Liu , David Gibson , linuxppc-dev@lists.ozlabs.org On 2012-7-3 4:43, Yinghai Lu wrote: > On Sun, Jul 1, 2012 at 7:01 PM, Jiang Liu wrote: >> Hi Yinghai, >> The patch fails compilation as below: >> mm/page_alloc.c:151: error: initializer element is not constant >> mm/page_alloc.c:151: error: expected ?,? or ?;? before ?__attribute__? >> >> On IA64, HUGETLB_PAGE_ORDER has dependency on variable hpage_shift. >> # define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) >> # define HPAGE_SHIFT hpage_shift >> >> And hpage_shift could be changed by early parameter "hugepagesz". >> So seems will still need to keep function set_pageblock_order(). > > ah, then use use _DEFAULT instead and later could update that in earlyparam. > > So attached -v2 should work. 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. So it would be better to keep function set_pageblock_order(), it will fix the memory wasting on both IA64 and PowerPC. Thanks! Gerry > > Thanks > > Yinghai -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [119.145.14.65]) by ozlabs.org (Postfix) with ESMTP id CFD4E2C00A7 for ; Tue, 3 Jul 2012 13:05:37 +1000 (EST) Message-ID: <4FF25EFA.1080004@huawei.com> Date: Tue, 3 Jul 2012 10:54:50 +0800 From: Jiang Liu MIME-Version: 1.0 To: Yinghai Lu 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> In-Reply-To: Content-Type: text/plain; charset="windows-1252" Cc: Tony Luck , linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Minchan Kim , Keping Chen , Mel Gorman , KOSAKI Motohiro , David Rientjes , Xishi Qiu , Andrew Morton , David Gibson , linuxppc-dev@lists.ozlabs.org, KAMEZAWA Hiroyuki , Jiang Liu List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 2012-7-3 4:43, Yinghai Lu wrote: > On Sun, Jul 1, 2012 at 7:01 PM, Jiang Liu wrote: >> Hi Yinghai, >> The patch fails compilation as below: >> mm/page_alloc.c:151: error: initializer element is not constant >> mm/page_alloc.c:151: error: expected ‘,’ or ‘;’ before ‘__attribute__’ >> >> On IA64, HUGETLB_PAGE_ORDER has dependency on variable hpage_shift. >> # define HUGETLB_PAGE_ORDER (HPAGE_SHIFT - PAGE_SHIFT) >> # define HPAGE_SHIFT hpage_shift >> >> And hpage_shift could be changed by early parameter "hugepagesz". >> So seems will still need to keep function set_pageblock_order(). > > ah, then use use _DEFAULT instead and later could update that in earlyparam. > > So attached -v2 should work. 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. So it would be better to keep function set_pageblock_order(), it will fix the memory wasting on both IA64 and PowerPC. Thanks! Gerry > > Thanks > > Yinghai