lkml.org 
[lkml]   [2016]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] proc: mm: export PTE sizes directly in smaps (v2)
From
Date
On 11/28/2016 05:52 PM, Dave Hansen wrote:
> On 11/24/2016 06:22 AM, Vlastimil Babka wrote:
>> On 11/17/2016 01:28 AM, Dave Hansen wrote:
>>> @@ -702,11 +707,13 @@ static int smaps_hugetlb_range(pte_t *pt
>>> }
>>> if (page) {
>>> int mapcount = page_mapcount(page);
>>> + unsigned long hpage_size = huge_page_size(hstate_vma(vma));
>>>
>>> + mss->rss_pud += hpage_size;
>>
>> This hardcoded pud doesn't look right, doesn't the pmd/pud depend on
>> hpage_size?
>
> Urg, nope. Thanks for noticing that! I think we'll need something
> along the lines of:
>
> if (hpage_size == PUD_SIZE)
> mss->rss_pud += PUD_SIZE;
> else if (hpage_size == PMD_SIZE)
> mss->rss_pmd += PMD_SIZE;

Sounds better, although I wonder whether there are some weird arches
supporting hugepage sizes that don't match page table levels. I recall
that e.g. MIPS could do arbitrary size, but dunno if the kernel supports
that...

> I'll respin and resend.
>

\
 
 \ /
  Last update: 2016-11-28 22:08    [W:0.092 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site