Re: [RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Matthew Wilcox <willy@xxxxxxxxxxxxx>
- Subject: Re: [RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers
- From: Anshuman Khandual <anshuman.khandual@xxxxxxx>
- Date: Mon, 26 Aug 2019 08:07:13 +0530
- Cc: linux-mm@xxxxxxxxx, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Vlastimil Babka <vbabka@xxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Mike Rapoport <rppt@xxxxxxxxxxxxxxxxxx>, Jason Gunthorpe <jgg@xxxxxxxx>, Dan Williams <dan.j.williams@xxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Michal Hocko <mhocko@xxxxxxxxxx>, Mark Rutland <mark.rutland@xxxxxxx>, Mark Brown <broonie@xxxxxxxxxx>, Steven Price <Steven.Price@xxxxxxx>, Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx>, Masahiro Yamada <yamada.masahiro@xxxxxxxxxxxxx>, Kees Cook <keescook@xxxxxxxxxxxx>, Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>, Sri Krishna chowdary <schowdary@xxxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxx>, Russell King - ARM Linux <linux@xxxxxxxxxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Paul Mackerras <paulus@xxxxxxxxx>, Martin Schwidefsky <schwidefsky@xxxxxxxxxx>, Heiko Carstens <heiko.carstens@xxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Vineet Gupta <vgupta@xxxxxxxxxxxx>, James Hogan <jhogan@xxxxxxxxxx>, Paul Burton <paul.burton@xxxxxxxx>, Ralf Baechle <ralf@xxxxxxxxxxxxxx>, linux-snps-arc@xxxxxxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
- In-reply-to: <20190809135202.GN5482@bombadil.infradead.org>
- References: <1565335998-22553-1-git-send-email-anshuman.khandual@arm.com> <20190809101632.GM5482@bombadil.infradead.org> <a5aab7ff-f7fd-9cc1-6e37-e4185eee65ac@arm.com> <20190809135202.GN5482@bombadil.infradead.org>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1
On 08/09/2019 07:22 PM, Matthew Wilcox wrote:
> On Fri, Aug 09, 2019 at 04:05:07PM +0530, Anshuman Khandual wrote:
>> On 08/09/2019 03:46 PM, Matthew Wilcox wrote:
>>> On Fri, Aug 09, 2019 at 01:03:17PM +0530, Anshuman Khandual wrote:
>>>> Should alloc_gigantic_page() be made available as an interface for general
>>>> use in the kernel. The test module here uses very similar implementation from
>>>> HugeTLB to allocate a PUD aligned memory block. Similar for mm_alloc() which
>>>> needs to be exported through a header.
>>>
>>> Why are you allocating memory at all instead of just using some
>>> known-to-exist PFNs like I suggested?
>>
>> We needed PFN to be PUD aligned for pfn_pud() and PMD aligned for mk_pmd().
>> Now walking the kernel page table for a known symbol like kernel_init()
>
> I didn't say to walk the kernel page table. I said to call virt_to_pfn()
> for a known symbol like kernel_init().
>
>> as you had suggested earlier we might encounter page table page entries at PMD
>> and PUD which might not be PMD or PUD aligned respectively. It seemed to me
>> that alignment requirement is applicable only for mk_pmd() and pfn_pud()
>> which create large mappings at those levels but that requirement does not
>> exist for page table pages pointing to next level. Is not that correct ? Or
>> I am missing something here ?
>
> Just clear the bottom bits off the PFN until you get a PMD or PUD aligned
> PFN. It's really not hard.
As Mark pointed out earlier that might end up being just a synthetic PFN
which might not even exist on a given system.
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]