lkml.org 
[lkml]   [2018]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 5/5] x86/mm: Drop usage of __flush_tlb_all() in kernel_physical_mapping_init()
On Fri, Nov 30, 2018 at 04:35:32PM -0800, Dan Williams wrote:
>Commit f77084d96355 "x86/mm/pat: Disable preemption around
>__flush_tlb_all()" addressed a case where __flush_tlb_all() is called
>without preemption being disabled. It also left a warning to catch other
>cases where preemption is not disabled. That warning triggers for the
>memory hotplug path which is also used for persistent memory enabling:
>
> WARNING: CPU: 35 PID: 911 at ./arch/x86/include/asm/tlbflush.h:460
> RIP: 0010:__flush_tlb_all+0x1b/0x3a
> [..]
> Call Trace:
> phys_pud_init+0x29c/0x2bb
> kernel_physical_mapping_init+0xfc/0x219
> init_memory_mapping+0x1a5/0x3b0
> arch_add_memory+0x2c/0x50
> devm_memremap_pages+0x3aa/0x610
> pmem_attach_disk+0x585/0x700 [nd_pmem]
>
>Andy wondered why a path that can sleep was using __flush_tlb_all() [1]
>and Dave confirmed the expectation for TLB flush is for modifying /
>invalidating existing pte entries, but not initial population [2]. Drop
>the usage of __flush_tlb_all() in phys_{p4d,pud,pmd}_init() on the
>expectation that this path is only ever populating empty entries for the
>linear map. Note, at linear map teardown time there is a call to the
>all-cpu flush_tlb_all() to invalidate the removed mappings.
>
>[1]: https://lore.kernel.org/lkml/9DFD717D-857D-493D-A606-B635D72BAC21@amacapital.net
>[2]: https://lore.kernel.org/lkml/749919a4-cdb1-48a3-adb4-adb81a5fa0b5@intel.com
>
>Fixes: f77084d96355 ("x86/mm/pat: Disable preemption around __flush_tlb_all()")
>Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
>Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>Cc: Thomas Gleixner <tglx@linutronix.de>
>Cc: Peter Zijlstra <peterz@infradead.org>
>Cc: Borislav Petkov <bp@alien8.de>
>Cc: <stable@vger.kernel.org>
>Reported-by: Andy Lutomirski <luto@kernel.org>
>Suggested-by: Dave Hansen <dave.hansen@linux.intel.com>
>Signed-off-by: Dan Williams <dan.j.williams@intel.com>

Hi Dan,

This patch on it's own doesn't apply to any of the stable trees, does it
maybe depend on some of the previous patches in this series?

--
Thanks,
Sasha

\
 
 \ /
  Last update: 2018-12-02 07:43    [W:0.139 / U:0.984 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site