Subject: Re: [RFC PATCH powerpc] try secondary hash before BUG in kernel_map_linear_page()

From: Michael Ellerman <[email-masked]>
Date: Wed, 10 Apr 2013 12:21:08 +1000

On Mon, Feb 25, 2013 at 05:29:35PM +0800, Li Zhong wrote:
> This patch tries to fix following issue when CONFIG_DEBUG_PAGEALLOC
> is enabled:
> 
> [  543.075675] ------------[ cut here ]------------
> [  543.075701] kernel BUG at arch/powerpc/mm/hash_utils_64.c:1239!
> [  543.075714] Oops: Exception in kernel mode, sig: 5 [#1]

So the issue is that kernel_map_linear_page() doesn't try the secondary
hash slot.

> The code is borrowed from that in __hash_page_huge().

It is, and in fact there is another copy in hash_low_64.S - in assembler.

So I think we should at least try and keep ourselves to two
implementations, one in asm and one in C. So can you split it out into a
helper routine called by both kernel_map_linear_page() and
__hash_page_huge() ?

cheers