Re: [PATCH v3 27/34] mm: pagewalk: Add 'depth' parameter to pte_hole

2019-03-01 Thread Steven Price
On 28/02/2019 19:00, Dave Hansen wrote: > On 2/28/19 3:28 AM, Steven Price wrote: >> static int get_level(unsigned long addr, unsigned long end) >> { >> /* Add 1 to account for ~0ULL */ >> unsigned long size = (end - addr) + 1; >> if (size < PMD_SIZE) >> return 4; >>

Re: [PATCH v3 27/34] mm: pagewalk: Add 'depth' parameter to pte_hole

2019-02-28 Thread Dave Hansen
On 2/28/19 3:28 AM, Steven Price wrote: > static int get_level(unsigned long addr, unsigned long end) > { > /* Add 1 to account for ~0ULL */ > unsigned long size = (end - addr) + 1; > if (size < PMD_SIZE) > return 4; > else if (size < PUD_SIZE) >

Re: [PATCH v3 27/34] mm: pagewalk: Add 'depth' parameter to pte_hole

2019-02-28 Thread Steven Price
On 27/02/2019 17:38, Dave Hansen wrote: > On 2/27/19 9:06 AM, Steven Price wrote: >> #ifdef CONFIG_SHMEM >> static int smaps_pte_hole(unsigned long addr, unsigned long end, >> -struct mm_walk *walk) >> + __always_unused int depth, struct mm_walk *walk) >> { > >

Re: [PATCH v3 27/34] mm: pagewalk: Add 'depth' parameter to pte_hole

2019-02-27 Thread Dave Hansen
On 2/27/19 9:06 AM, Steven Price wrote: > #ifdef CONFIG_SHMEM > static int smaps_pte_hole(unsigned long addr, unsigned long end, > - struct mm_walk *walk) > + __always_unused int depth, struct mm_walk *walk) > { I think this 'depth' argument is a mistake. It's

[PATCH v3 27/34] mm: pagewalk: Add 'depth' parameter to pte_hole

2019-02-27 Thread Steven Price
The pte_hole() callback is called at multiple levels of the page tables. Code dumping the kernel page tables needs to know what at what depth the missing entry is. Add this is an extra parameter to pte_hole(). When the depth isn't know (e.g. processing a vma) then -1 is passed. The depth that is r