
From: Dave Hansen <haveblue@us.ibm.com>

With PAE on, there are only 4 PGD entries.  The kernel ones never change,
so there is no need to copy them when a vmalloc fault occurs.  This was
this was causing problems with the split pmd patches, but it is still
correct for mainline.

Tested with and without PAE.  I ran it in a loop turning on and off 10 swap
partitions, which is what excited the original bug. 
http://bugme.osdl.org/show_bug.cgi?id=640



 25-akpm/arch/i386/mm/fault.c |    8 ++++++++
 1 files changed, 8 insertions(+)

diff -puN arch/i386/mm/fault.c~dont-set-kernel-pgd-on-PAE arch/i386/mm/fault.c
--- 25/arch/i386/mm/fault.c~dont-set-kernel-pgd-on-PAE	Wed Apr 30 16:52:01 2003
+++ 25-akpm/arch/i386/mm/fault.c	Wed Apr 30 16:52:01 2003
@@ -333,7 +333,15 @@ vmalloc_fault:
 
 		if (!pgd_present(*pgd_k))
 			goto no_context;
+		/*
+		 * kernel pmd pages are shared among all processes
+		 * with PAE on.  Since vmalloc pages are always
+		 * in the kernel area, this will always be a 
+		 * waste with PAE on.
+		 */
+#ifndef CONFIG_X86_PAE
 		set_pgd(pgd, *pgd_k);
+#endif
 		
 		pmd = pmd_offset(pgd, address);
 		pmd_k = pmd_offset(pgd_k, address);

_
