Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jul 2002 20:21:32 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 14123 for review
Message-ID:  <200207120321.g6C3LWj8097206@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=14123

Change 14123 by peter@peter_daintree on 2002/07/11 20:20:33

	Back off on the pmap_zero_page and pmap_copy_page optimizations, since
	they could suffer the same problem as pmap_zero_page_idle (noticed
	by Matt).  These can be fixed with a cpu_switch hook.

Affected files ...

.. //depot/projects/pmap/sys/i386/i386/pmap.c#22 edit

Differences ...

==== //depot/projects/pmap/sys/i386/i386/pmap.c#22 (text+ko) ====

@@ -2674,7 +2674,7 @@
 	if (*CMAP2)
 		panic("pmap_zero_page: CMAP2 busy");
 	*CMAP2 = PG_V | PG_RW | phys | PG_A | PG_M;
-	invlpg((vm_offset_t)CADDR2);	/* SMP: local cpu only */
+	pmap_invalidate_page(kernel_pmap, (vm_offset_t)CADDR2);
 #if defined(I686_CPU)
 	if (cpu_class == CPUCLASS_686)
 		i686_pagezero(CADDR2);
@@ -2682,7 +2682,6 @@
 #endif
 		bzero(CADDR2, PAGE_SIZE);
 	*CMAP2 = 0;
-	invlpg((vm_offset_t)CADDR2);	/* SMP: local cpu only */
 }
 
 /*
@@ -2707,7 +2706,7 @@
 	if (*CMAP2)
 		panic("pmap_zero_page: CMAP2 busy");
 	*CMAP2 = PG_V | PG_RW | phys | PG_A | PG_M;
-	invlpg((vm_offset_t)CADDR2);	/* SMP: local cpu only */
+	pmap_invalidate_page(kernel_pmap, (vm_offset_t)CADDR2);
 #if defined(I686_CPU)
 	if (cpu_class == CPUCLASS_686 && off == 0 && size == PAGE_SIZE)
 		i686_pagezero(CADDR2);
@@ -2715,7 +2714,6 @@
 #endif
 		bzero((char *)CADDR2 + off, size);
 	*CMAP2 = 0;
-	invlpg((vm_offset_t)CADDR2);	/* SMP: local cpu only */
 }
 
 /*
@@ -2748,7 +2746,6 @@
 #endif
 		bzero(CADDR3, PAGE_SIZE);
 	*CMAP3 = 0;
-	invlpg((vm_offset_t)CADDR3);	/* SMP: local cpu only */
 }
 
 /*
@@ -2767,13 +2764,15 @@
 		panic("pmap_copy_page: CMAP2 busy");
 	*CMAP1 = PG_V | VM_PAGE_TO_PHYS(src) | PG_A;
 	*CMAP2 = PG_V | PG_RW | VM_PAGE_TO_PHYS(dst) | PG_A | PG_M;
-	invlpg((vm_offset_t)CADDR1);	/* SMP: local cpu only */
-	invlpg((vm_offset_t)CADDR2);	/* SMP: local cpu only */
+	/*
+	 * XXX we "know" that CADDR2 immediately follows CADDR1 and use
+	 * that to save an IPI on SMP systems.
+	 */
+	pmap_invalidate_range(kernel_pmap, (vm_offset_t)CADDR1,
+	    (vm_offset_t)CADDR2);
 	bcopy(CADDR1, CADDR2, PAGE_SIZE);
 	*CMAP1 = 0;
 	*CMAP2 = 0;
-	invlpg((vm_offset_t)CADDR1);	/* SMP: local cpu only */
-	invlpg((vm_offset_t)CADDR2);	/* SMP: local cpu only */
 }
 
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200207120321.g6C3LWj8097206>