Re: [PATCH v2 3/5] powerpc/mm: Allow more than 16 low slices

From: Aneesh Kumar K.V
Date: Fri Jan 19 2018 - 04:07:45 EST




On 01/19/2018 02:29 PM, Christophe LEROY wrote:


Le 19/01/2018 Ã 09:30, Aneesh Kumar K.V a ÃcritÂ:
Christophe Leroy <christophe.leroy@xxxxxx> writes:

While the implementation of the "slices" address space allows
a significant amount of high slices, it limits the number of
low slices to 16 due to the use of a single u64 low_slices_psize
element in struct mm_context_t

On the 8xx, the minimum slice size is the size of the area
covered by a single PMD entry, ie 4M in 4K pages mode and 64M in
16K pages mode. This means we could have resp. up to 1024 and 64
slices.

In order to override this limitation, this patch switches the
handling of low_slices to BITMAPs as done already for high_slices.

Does it have a performance impact. When we switched high_slices
that was one of the question asked. Now with a topdown search we should
mostly be using the high_slices. But it will good to get numbers for
ppc64 for this change.

It should have almost no performance impact at all, because all bitmap functions used a simplified way when the number of bits is small and constant:

-ÂÂÂ ret->low_slices = 0;
+ÂÂÂ slice_bitmap_zero(ret->low_slices, SLICE_NUM_LOW);


static inline void bitmap_zero(unsigned long *dst, unsigned int nbits)
{
ÂÂÂÂif (small_const_nbits(nbits))
ÂÂÂÂÂÂÂ *dst = 0UL;
ÂÂÂÂelse {
ÂÂÂÂÂÂÂ unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
ÂÂÂÂÂÂÂ memset(dst, 0, len);
ÂÂÂÂ}
}



-ÂÂÂ dst->low_slices |= src->low_slices;
+ÂÂÂ slice_bitmap_or(dst->low_slices, dst->low_slices, src->low_slices,
+ÂÂÂÂÂÂÂÂÂÂÂ SLICE_NUM_LOW);


static inline void bitmap_or(unsigned long *dst, const unsigned long *src1,
ÂÂÂÂÂÂÂÂÂÂÂ const unsigned long *src2, unsigned int nbits)
{
ÂÂÂÂif (small_const_nbits(nbits))
ÂÂÂÂÂÂÂ *dst = *src1 | *src2;
ÂÂÂÂelse
ÂÂÂÂÂÂÂ __bitmap_or(dst, src1, src2, nbits);
}




may be capture that in commit message saying since we are 64 bit on ppc64 there is no impact there?

-aneesh