From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Capper Subject: Re: [RFC PATCH v2 05/11] mm: thp: Correct the HPAGE_PMD_ORDER check. Date: Wed, 8 May 2013 13:03:08 +0100 Message-ID: <20130508120307.GA1407@linaro.org> References: <1368006763-30774-1-git-send-email-steve.capper@linaro.org> <1368006763-30774-6-git-send-email-steve.capper@linaro.org> <20130508124417.GA29631@shutemov.name> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20130508124417.GA29631@shutemov.name> Sender: owner-linux-mm@kvack.org To: "Kirill A. Shutemov" Cc: linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michal Hocko , Ken Chen , Mel Gorman , Catalin Marinas , Will Deacon , patches@linaro.org List-Id: linux-arch.vger.kernel.org On Wed, May 08, 2013 at 03:44:17PM +0300, Kirill A. Shutemov wrote: > On Wed, May 08, 2013 at 10:52:37AM +0100, Steve Capper wrote: > > All Transparent Huge Pages are allocated by the buddy allocator. > > > > A compile time check is in place that fails when the order of a > > transparent huge page is too large to be allocated by the buddy > > allocator. Unfortunately that compile time check passes when: > > HPAGE_PMD_ORDER == MAX_ORDER > > ( which is incorrect as the buddy allocator can only allocate > > memory of order strictly less than MAX_ORDER. ) > > It looks confusing to me. Shouldn't we fix what MAX_ORDER means instead? > It confused me as I originally had 13 as the order and couldn't allocate any 512MB THPs :-). MAX_ORDER appears to be used quite a lot so I think it would be safer to change the use case here rather than its meaning. Cheers, -- Steve -- 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 mail-we0-f175.google.com ([74.125.82.175]:42913 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755165Ab3EHMDU (ORCPT ); Wed, 8 May 2013 08:03:20 -0400 Received: by mail-we0-f175.google.com with SMTP id p57so1740926wes.20 for ; Wed, 08 May 2013 05:03:19 -0700 (PDT) Date: Wed, 8 May 2013 13:03:08 +0100 From: Steve Capper Subject: Re: [RFC PATCH v2 05/11] mm: thp: Correct the HPAGE_PMD_ORDER check. Message-ID: <20130508120307.GA1407@linaro.org> References: <1368006763-30774-1-git-send-email-steve.capper@linaro.org> <1368006763-30774-6-git-send-email-steve.capper@linaro.org> <20130508124417.GA29631@shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130508124417.GA29631@shutemov.name> Sender: linux-arch-owner@vger.kernel.org List-ID: To: "Kirill A. Shutemov" Cc: linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michal Hocko , Ken Chen , Mel Gorman , Catalin Marinas , Will Deacon , patches@linaro.org Message-ID: <20130508120308.u_gMv8XmGOCYiLmJsI9QlOsUpoZ2ia1qywDDctTfXNM@z> On Wed, May 08, 2013 at 03:44:17PM +0300, Kirill A. Shutemov wrote: > On Wed, May 08, 2013 at 10:52:37AM +0100, Steve Capper wrote: > > All Transparent Huge Pages are allocated by the buddy allocator. > > > > A compile time check is in place that fails when the order of a > > transparent huge page is too large to be allocated by the buddy > > allocator. Unfortunately that compile time check passes when: > > HPAGE_PMD_ORDER == MAX_ORDER > > ( which is incorrect as the buddy allocator can only allocate > > memory of order strictly less than MAX_ORDER. ) > > It looks confusing to me. Shouldn't we fix what MAX_ORDER means instead? > It confused me as I originally had 13 as the order and couldn't allocate any 512MB THPs :-). MAX_ORDER appears to be used quite a lot so I think it would be safer to change the use case here rather than its meaning. Cheers, -- Steve