All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/5] powerpc/mm: Remove intermediate bitmap copy in 'slices'
@ 2018-01-24  9:02 Christophe Leroy
  2018-01-24  9:02 ` [PATCH v3 2/5] powerpc/mm: Enhance 'slice' for supporting PPC32 Christophe Leroy
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Christophe Leroy @ 2018-01-24  9:02 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Scott Wood, aneesh.kumar
  Cc: linux-kernel, linuxppc-dev

bitmap_or() and bitmap_andnot() can work properly with dst identical
to src1 or src2. There is no need of an intermediate result bitmap
that is copied back to dst in a second step.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 v2: New in v2
 v3: patch moved up front of the serie to avoid ephemeral slice_bitmap_copy() function in following patch

 arch/powerpc/mm/slice.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index 23ec2c5e3b78..98b53d48968f 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -388,21 +388,17 @@ static unsigned long slice_find_area(struct mm_struct *mm, unsigned long len,
 
 static inline void slice_or_mask(struct slice_mask *dst, struct slice_mask *src)
 {
-	DECLARE_BITMAP(result, SLICE_NUM_HIGH);
-
 	dst->low_slices |= src->low_slices;
-	bitmap_or(result, dst->high_slices, src->high_slices, SLICE_NUM_HIGH);
-	bitmap_copy(dst->high_slices, result, SLICE_NUM_HIGH);
+	bitmap_or(dst->high_slices, dst->high_slices, src->high_slices,
+		  SLICE_NUM_HIGH);
 }
 
 static inline void slice_andnot_mask(struct slice_mask *dst, struct slice_mask *src)
 {
-	DECLARE_BITMAP(result, SLICE_NUM_HIGH);
-
 	dst->low_slices &= ~src->low_slices;
 
-	bitmap_andnot(result, dst->high_slices, src->high_slices, SLICE_NUM_HIGH);
-	bitmap_copy(dst->high_slices, result, SLICE_NUM_HIGH);
+	bitmap_andnot(dst->high_slices, dst->high_slices, src->high_slices,
+		      SLICE_NUM_HIGH);
 }
 
 #ifdef CONFIG_PPC_64K_PAGES
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2018-02-10 12:58 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-24  9:02 [PATCH v3 1/5] powerpc/mm: Remove intermediate bitmap copy in 'slices' Christophe Leroy
2018-01-24  9:02 ` [PATCH v3 2/5] powerpc/mm: Enhance 'slice' for supporting PPC32 Christophe Leroy
     [not found]   ` <87vafl18vu.fsf@linux.vnet.ibm.com>
2018-02-10 12:55     ` Christophe LEROY
2018-01-24  9:02 ` [PATCH v3 3/5] powerpc/32: Fix hugepage allocation on 8xx at hint address Christophe Leroy
2018-01-24  9:02 ` [PATCH v3 4/5] powerpc/mm: Allow up to 64 low slices Christophe Leroy
2018-01-29  6:29   ` Aneesh Kumar K.V
2018-01-29  8:56     ` Christophe LEROY
2018-02-10 12:58     ` Christophe LEROY
2018-01-24  9:02 ` [PATCH v3 5/5] powerpc/mm: Fix growth direction for hugepages mmaps with slice Christophe Leroy
2018-01-24  9:15   ` Aneesh Kumar K.V
2018-01-24  9:27     ` Christophe LEROY
2018-01-24  9:35       ` Aneesh Kumar K.V
2018-01-24  9:39         ` Christophe LEROY
2018-01-24  9:51           ` Aneesh Kumar K.V
2018-01-24 10:03             ` Christophe LEROY
2018-01-24 10:08               ` Aneesh Kumar K.V
2018-01-24 10:19                 ` Christophe LEROY
2018-01-29  6:17 ` [PATCH v3 1/5] powerpc/mm: Remove intermediate bitmap copy in 'slices' Aneesh Kumar K.V

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.