powerpc/book3s64/hash: Use secondary hash for bolted mapping if the primary is full
authorAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Thu, 24 Oct 2019 09:35:42 +0000 (15:05 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 28 Oct 2019 10:54:16 +0000 (21:54 +1100)
commitd78d5dace5398b542fd5a21b50db6e88ce7d392e
tree5535b8a1804be8acac2d2af6547ae031ff728a7f
parent75838a3290cd4ebbd1f567f310ba04b6ef017ce4
powerpc/book3s64/hash: Use secondary hash for bolted mapping if the primary is full

With bolted hash page table entry, kernel currently only use primary hash group
when inserting the hash page table entry. In the rare case where kernel find all the
8 primary hash slot occupied by bolted entries, this can result in hash page
table insert failure for bolted entries. Avoid this by using the secondary hash
group.

This is different from what kernel does for the non-bolted mapping. With
non-bolted entries kernel will try secondary before removing an existing entry
from hash page table group. With bolted prefer primary hash group and hence
try to insert the page table entry by removing a slot from primary before trying
the secondary hash group.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191024093542.29777-3-aneesh.kumar@linux.ibm.com
arch/powerpc/mm/book3s64/hash_native.c
arch/powerpc/mm/book3s64/hash_utils.c
arch/powerpc/platforms/pseries/lpar.c