Thread (31 messages) flat view 31 messages, 3 authors, 2018-03-20

Re: [PATCH 10/10] powerpc/mm/slice: remove radix calls to the slice code

From: Nicholas Piggin <npiggin@gmail.com>
Date: 2018-03-06 23:36:05

On Tue, 6 Mar 2018 16:12:34 +0100
Christophe LEROY [off-list ref] wrote:
Le 06/03/2018 à 14:25, Nicholas Piggin a écrit :
quoted
This is a tidy up which removes radix MMU calls into the slice
code.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
  arch/powerpc/include/asm/hugetlb.h |  9 ++++++---
  arch/powerpc/mm/hugetlbpage.c      |  5 +++--
  arch/powerpc/mm/slice.c            | 17 ++++-------------
  3 files changed, 13 insertions(+), 18 deletions(-)
diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
index 1a4847f67ea8..59885d444695 100644
--- a/arch/powerpc/include/asm/hugetlb.h
+++ b/arch/powerpc/include/asm/hugetlb.h
@@ -90,16 +90,19 @@ pte_t *huge_pte_offset_and_shift(struct mm_struct *mm,
  void flush_dcache_icache_hugepage(struct page *page);
  
  #if defined(CONFIG_PPC_MM_SLICES)
-int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
+int slice_is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
  			   unsigned long len);
-#else
+#endif
  static inline int is_hugepage_only_range(struct mm_struct *mm,
  					 unsigned long addr,
  					 unsigned long len)
  {
+#if defined(CONFIG_PPC_MM_SLICES)
+	if (!radix_enabled())
+		return slice_is_hugepage_only_range(mm, addr, len);
+#endif
  	return 0;  
Might be easier to understand as

	if (!IS_ENABLED(CONFIG_PPC_MM_SLICES) || radix_enabled())
		return 0;
	return slice_is_hugepage_only_range(mm, addr, len);
Yep.

quoted
  unsigned long vma_mmu_pagesize(struct vm_area_struct *vma)
  {
  #ifdef CONFIG_PPC_MM_SLICES
-	unsigned int psize = get_slice_psize(vma->vm_mm, vma->vm_start);
  	/* With radix we don't use slice, so derive it from vma*/
-	if (!radix_enabled())
+	if (!radix_enabled()) {
+		unsigned int psize = get_slice_psize(vma->vm_mm, vma->vm_start);  
Insert a blank line here.
Okay.

Thanks for the review, it's really appreciated.

Thanks,
Nick
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help