Re: [PATCH 08/10] powerpc/mm/slice: Use const pointers to cached slice masks where possible
From: Nicholas Piggin <npiggin@gmail.com>
Date: 2018-03-06 23:34:06
On Tue, 6 Mar 2018 15:55:04 +0100 Christophe LEROY [off-list ref] wrote:
Le 06/03/2018 à 14:25, Nicholas Piggin a écrit :
quoted
@@ -572,11 +555,19 @@ unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len, #ifdef CONFIG_PPC_64K_PAGES /* If we support combo pages, we can allow 64k pages in 4k slices */ if (psize == MMU_PAGE_64K) { - compat_mask = *slice_mask_for_size(mm, MMU_PAGE_4K); + compat_maskp = slice_mask_for_size(mm, MMU_PAGE_4K); if (fixed) - slice_or_mask(&good_mask, &good_mask, &compat_mask); - } + slice_or_mask(&good_mask, maskp, compat_maskp); + else + slice_copy_mask(&good_mask, maskp); + } else #endif + { + slice_copy_mask(&good_mask, maskp); + }You could get something nicer by removing that #ifdef and doing instead: if (IS_ENABLED(CONFIG_PPC_64K_PAGES) && psize == MMU_PAGE_64K) { ... } else { slice_copy_mask(&good_mask, maskp); }
Yeah that's nicer.
quoted
-#if 0 /* too verbose */ - slice_dbg("is_hugepage_only_range(mm=%p, addr=%lx, len=%lx)\n", - mm, addr, len); - slice_print_mask(" mask", &mask); - slice_print_mask(" available", &available); -#endifThat's cleanup, should be in a previous patch.
Okay. Thanks, Nick