Subject: Re: [PATCH v5 3/7] powerpc/mm/hugetlb: Handle hugepage size supported by hash config

From: "Aneesh Kumar K.V" <[email-masked]>
Date: Wed, 23 Nov 2016 20:00:21 +0530

Balbir Singh <[email-masked]> writes:

> On 23/11/16 22:09, Aneesh Kumar K.V wrote:
>> W.r.t hash page table config, we support 16MB and 16GB as the hugepage
>> size. Update the hstate_get_psize to handle 16M and 16G.
>> 
>> Signed-off-by: Aneesh Kumar K.V <[email-masked]>
>> ---
>>  arch/powerpc/include/asm/book3s/64/hugetlb.h | 4 ++++
>>  1 file changed, 4 insertions(+)
>> 
>> diff --git a/arch/powerpc/include/asm/book3s/64/hugetlb.h b/arch/powerpc/include/asm/book3s/64/hugetlb.h
>> index 499268045306..d9c283f95e05 100644
>> --- a/arch/powerpc/include/asm/book3s/64/hugetlb.h
>> +++ b/arch/powerpc/include/asm/book3s/64/hugetlb.h
>> @@ -21,6 +21,10 @@ static inline int hstate_get_psize(struct hstate *hstate)
>>  		return MMU_PAGE_2M;
>>  	else if (shift == mmu_psize_defs[MMU_PAGE_1G].shift)
>>  		return MMU_PAGE_1G;
>> +	else if (shift == mmu_psize_defs[MMU_PAGE_16M].shift)
>> +		return MMU_PAGE_16M;
>> +	else if (shift == mmu_psize_defs[MMU_PAGE_16G].shift)
>> +		return MMU_PAGE_16G;
>>  	else {
>>  		WARN(1, "Wrong huge page shift\n");
>>  		return mmu_virtual_psize;
>> 
>
> Is this related to this patch series? Radix can't do these sizes
>

The code returns the psize (the index value of the page size ) from hstate.
It doesn't make any verification. I added the hash details here because
this header is now suppose to contain generic functions not radix
specific one.

-aneesh