On Wednesday 29 March 2017 08:41 AM, Paul Mackerras wrote:
On Wed, Mar 22, 2017 at 09:06:47AM +0530, Aneesh Kumar K.V wrote:
In followup patch we want to increase the va range which will result
in us requiring high_slices to have more than 64 bits. To enable this
convert high_slices to bitmap. We keep the number bits same in this patch
and later change that to higher value
See comment below...
@@ -531,8 +569,8 @@ unsigned long slice_get_unmapped_area(unsigned long addr,
unsigned long len,
slice_print_mask(" mask", mask);
convert:
- andnot_mask(mask, good_mask);
- andnot_mask(mask, compat_mask);
+ slice_andnot_mask(&mask, &good_mask);
+ slice_andnot_mask(&mask, &compat_mask);
if (mask.low_slices || mask.high_slices) {
The test on mask.high_slices here wants to test whether high_slices
has any bits set, but with the conversion to a bitmap, the test will
be always true since what will be tested is the address of the array
in the bitmap.
Thanks for the review. How about the below change ?
diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
index f808f99372e4..252d90b7c3c5 100644
--- a/arch/powerpc/mm/slice.c
+++ b/arch/powerpc/mm/slice.c
@@ -588,7 +588,7 @@ unsigned long slice_get_unmapped_area(unsigned long
addr, unsigned long len,
convert:
slice_andnot_mask(&mask, &good_mask);
slice_andnot_mask(&mask, &compat_mask);
- if (mask.low_slices || mask.high_slices) {
+ if (mask.low_slices || !bitmap_empty(mask.high_slices,
SLICE_NUM_HIGH)) {
slice_convert(mm, mask, psize);
if (psize > MMU_PAGE_BASE)
on_each_cpu(slice_flush_segments, mm, 1);