[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190220205930.GL12668@bombadil.infradead.org>
Date: Wed, 20 Feb 2019 12:59:30 -0800
From: Matthew Wilcox <willy@...radead.org>
To: Yu Zhao <yuzhao@...gle.com>
Cc: Anshuman Khandual <anshuman.khandual@....com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
"Aneesh Kumar K . V" <aneesh.kumar@...ux.vnet.ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Nick Piggin <npiggin@...il.com>,
Peter Zijlstra <peterz@...radead.org>,
Joel Fernandes <joel@...lfernandes.org>,
"Kirill A . Shutemov" <kirill@...temov.name>,
Mark Rutland <mark.rutland@....com>,
Ard Biesheuvel <ard.biesheuvel@...aro.org>,
Chintan Pandya <cpandya@...eaurora.org>,
Jun Yao <yaojun8558363@...il.com>,
Laura Abbott <labbott@...hat.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-arch@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH v2 1/3] arm64: mm: use appropriate ctors for page tables
On Wed, Feb 20, 2019 at 01:22:44PM -0700, Yu Zhao wrote:
> On Wed, Feb 20, 2019 at 03:57:59PM +0530, Anshuman Khandual wrote:
> > Using pgtable_pmd_page_ctor() during PMD level pgtable page allocation
> > as suggested in the patch breaks pmd_alloc_one() changes as per the
> > previous proposal. Hence we all would need some agreement here.
> >
> > https://www.spinics.net/lists/arm-kernel/msg701960.html
>
> A proposal that requires all page tables to go through a same set of
> ctors on all archs is not only inefficient (for kernel page tables)
> but also infeasible (for arches use kmem for page tables). I've
> explained this clearly.
>
> The generalized page table functions must recognize the differences
> on different levels and between user and kernel page tables, and
> provide unified api that is capable of handling the differences.
The two architectures I'm aware of (s390 and power) which use sub-page
allocations for page tables do so by allocating entire pages and then
implementing their own allocators. It shouldn't be a huge problem to
use a ctor for the pages. We can probably even implement a dtor for them.
Oh, another corner-case I've just remembered is x86-32's PAE with four
8-byte entries in the PGD. That should also go away and be replaced
with a shared implementation of sub-page allocations which can also be
marked as PageTable.
Ideally PTEs, PMDs, etc, etc would all be accounted to the individual
processes causing them to be allocated. This isn't really feasible
with the x86 PGD; by definition there's only one per process. I'm OK
with failing to account this 32-byte allocation to the task though.
So maybe the pgd_cache can remain separate from the hypothetical unified
ppc/s390 code.
Powered by blists - more mailing lists