powerpc/kexec: Speedup kexec hash PTE tear down
commit5c1ce60272a33ea4864e24d7dea40af3d947374a
authorMichael Neuling <mikey@neuling.org>
Mon, 10 May 2010 20:28:26 +0000 (10 20:28 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 21 Mar 2011 19:45:33 +0000 (21 12:45 -0700)
treee00555d2c7f1a0e8fc13bf48f9de4a03cb09769e
parent543366ccb6d8fe2b42e5653c374b1109208b4700
powerpc/kexec: Speedup kexec hash PTE tear down

commit d504bed676caad29a3dba3d3727298c560628f5c upstream.

Currently for kexec the PTE tear down on 1TB segment systems normally
requires 3 hcalls for each PTE removal. On a machine with 32GB of
memory it can take around a minute to remove all the PTEs.

This optimises the path so that we only remove PTEs that are valid.
It also uses the read 4 PTEs at once HCALL.  For the common case where
a PTEs is invalid in a 1TB segment, this turns the 3 HCALLs per PTE
down to 1 HCALL per 4 PTEs.

This gives an > 10x speedup in kexec times on PHYP, taking a 32GB
machine from around 1 minute down to a few seconds.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Kamalesh babulal <kamalesh@linux.vnet.ibm.com>
cc: Anton Blanchard <anton@samba.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/powerpc/platforms/pseries/lpar.c