Thread (39 messages) 39 messages, 5 authors, 2018-09-19

Re: [RFC][PATCH 03/11] x86/mm: Page size aware flush_tlb_mm_range()

From: Dave Hansen <dave.hansen@linux.intel.com>
Date: 2018-09-13 18:49:31
Also in: linux-arch, lkml

On 09/13/2018 11:46 AM, Peter Zijlstra wrote:
On Thu, Sep 13, 2018 at 08:42:30PM +0200, Peter Zijlstra wrote:
quoted
quoted
quoted
+#define flush_tlb_range(vma, start, end)			\
+		flush_tlb_mm_range((vma)->vm_mm, start, end,	\
+				(vma)->vm_flags & VM_HUGETLB ? PMD_SHIFT : PAGE_SHIFT)
This is safe.  But, Couldn't this PMD_SHIFT also be PUD_SHIFT for a 1G
hugetlb page?
It could be, but can we tell at that point?
I had me a look in higetlb.h, would something like so work?

#define flush_tlb_range(vma, start, end)			\
	flush_tlb_mm_range((vma)->vm_mm, start, end,		\
			   huge_page_shift(hstate_vma(vma)))
I think you still need the VM_HUGETLB check somewhere because
hstate_vma() won't work on non-VM_HUGETLB VMAs.  But, yeah, something
close to that should be OK.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help