From: Mike Rapoport <rppt@linux.ibm.com> To: Will Deacon <will@kernel.org> Cc: Catalin Marinas <catalin.marinas@arm.com>, x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Andrew Morton <akpm@linux-foundation.org>, Thomas Gleixner <tglx@linutronix.de>, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] mm: consolidate pgtable_cache_init() and pgd_cache_init() Date: Wed, 21 Aug 2019 19:01:59 +0300 Message-ID: <20190821160159.GG26713@rapoport-lnx> (raw) In-Reply-To: <20190821154942.js4u466rolnekwmq@willie-the-truck> On Wed, Aug 21, 2019 at 04:49:42PM +0100, Will Deacon wrote: > On Wed, Aug 21, 2019 at 06:06:58PM +0300, Mike Rapoport wrote: > > Both pgtable_cache_init() and pgd_cache_init() are used to initialize kmem > > cache for page table allocations on several architectures that do not use > > PAGE_SIZE tables for one or more levels of the page table hierarchy. > > > > Most architectures do not implement these functions and use __week default > > NOP implementation of pgd_cache_init(). Since there is no such default for > > pgtable_cache_init(), its empty stub is duplicated among most > > architectures. > > > > Rename the definitions of pgd_cache_init() to pgtable_cache_init() and drop > > empty stubs of pgtable_cache_init(). > > > > Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> > > --- > > [...] > > > diff --git a/arch/arm64/mm/pgd.c b/arch/arm64/mm/pgd.c > > index 7548f9c..4a64089 100644 > > --- a/arch/arm64/mm/pgd.c > > +++ b/arch/arm64/mm/pgd.c > > @@ -35,7 +35,7 @@ void pgd_free(struct mm_struct *mm, pgd_t *pgd) > > kmem_cache_free(pgd_cache, pgd); > > } > > > > -void __init pgd_cache_init(void) > > +void __init pgtable_cache_init(void) > > { > > if (PGD_SIZE == PAGE_SIZE) > > return; > > [...] > > > diff --git a/init/main.c b/init/main.c > > index b90cb5f..2fa8038 100644 > > --- a/init/main.c > > +++ b/init/main.c > > @@ -507,7 +507,7 @@ void __init __weak mem_encrypt_init(void) { } > > > > void __init __weak poking_init(void) { } > > > > -void __init __weak pgd_cache_init(void) { } > > +void __init __weak pgtable_cache_init(void) { } > > > > bool initcall_debug; > > core_param(initcall_debug, initcall_debug, bool, 0644); > > @@ -565,7 +565,6 @@ static void __init mm_init(void) > > init_espfix_bsp(); > > /* Should be run after espfix64 is set up. */ > > pti_init(); > > - pgd_cache_init(); > > } > > AFAICT, this change means we now initialise our pgd cache before > debug_objects_mem_init() has run. Right. > Is that going to cause fireworks with CONFIG_DEBUG_OBJECTS when we later > free a pgd? We don't allocate a pgd at that time, we only create the kmem cache for the future allocations. And that cache is never destroyed anyway. > Will -- Sincerely yours, Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply index Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-08-21 15:06 Mike Rapoport 2019-08-21 15:15 ` Matthew Wilcox 2019-08-21 15:29 ` Mike Rapoport 2019-08-21 15:49 ` Will Deacon 2019-08-21 16:01 ` Mike Rapoport [this message] 2019-08-21 16:34 ` Will Deacon 2019-08-21 18:36 ` Thomas Gleixner
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190821160159.GG26713@rapoport-lnx \ --to=rppt@linux.ibm.com \ --cc=akpm@linux-foundation.org \ --cc=bp@alien8.de \ --cc=catalin.marinas@arm.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-mm@kvack.org \ --cc=mingo@redhat.com \ --cc=tglx@linutronix.de \ --cc=will@kernel.org \ --cc=x86@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Linux-ARM-Kernel Archive on lore.kernel.org Archives are clonable: git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \ linux-arm-kernel@lists.infradead.org public-inbox-index linux-arm-kernel Example config snippet for mirrors Newsgroup available over NNTP: nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git