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: Anshuman Khandual <anshuman.khandual@xxxxxxx>
- Subject: Re: [RFC V2 0/1] mm/debug: Add tests for architecture exported page table helpers
- From: Matthew Wilcox <willy@xxxxxxxxxxxxx>
- Date: Fri, 9 Aug 2019 06:52:02 -0700
- 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: <a5aab7ff-f7fd-9cc1-6e37-e4185eee65ac@arm.com>
- References: <1565335998-22553-1-git-send-email-anshuman.khandual@arm.com> <20190809101632.GM5482@bombadil.infradead.org> <a5aab7ff-f7fd-9cc1-6e37-e4185eee65ac@arm.com>
- User-agent: Mutt/1.11.4 (2019-03-13)
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.
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]