Re: [PATCH] mm/THP: Don't use HPAGE_SHIFT in transparent hugepage code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 07, 2013 at 02:22:32AM +0530, Aneesh Kumar K.V wrote:
> From: "Aneesh Kumar K.V" <aneesh.kumar@xxxxxxxxxxxxxxxxxx>
> 
> For architectures like powerpc that support multiple explicit hugepage
> sizes, HPAGE_SHIFT indicate the default explicit hugepage shift. For
> THP to work the hugepage size should be same as PMD_SIZE. So use
> PMD_SHIFT directly. So move the define outside CONFIG_TRANSPARENT_HUGEPAGE
> #ifdef because we want to use these defines in generic code with
> if (pmd_trans_huge()) conditional.

Sorry, I haven't got why you move it outside #ifdef.
If CONFIG_TRANSPARENT_HUGEPAGE disabled pmd_trans_huge() will be 0 in
compile time, so BUILD_BUG() will be optimize out by GCC.

The BUILD_BUGs are useful. It's bug if you *really* use the defines with
THP disabled.

-- 
 Kirill A. Shutemov

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]