PERFORCE change 128553 for review
Robert Watson
rwatson at FreeBSD.org
Sat Nov 3 06:51:33 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=128553
Change 128553 by rwatson at rwatson_zoo on 2007/11/03 13:51:01
Integrate zero-copy BPF branch.
Affected files ...
.. //depot/projects/zcopybpf/src/sys/amd64/amd64/pmap.c#8 integrate
.. //depot/projects/zcopybpf/src/sys/dev/acpica/acpi_cpu.c#5 integrate
.. //depot/projects/zcopybpf/src/sys/i386/conf/PAE#5 integrate
.. //depot/projects/zcopybpf/src/sys/i386/i386/pmap.c#8 integrate
.. //depot/projects/zcopybpf/src/sys/kern/kern_fork.c#7 integrate
.. //depot/projects/zcopybpf/src/sys/vm/swap_pager.c#7 integrate
Differences ...
==== //depot/projects/zcopybpf/src/sys/amd64/amd64/pmap.c#8 (text+ko) ====
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.590 2007/08/21 04:59:33 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.591 2007/11/03 05:15:25 alc Exp $");
/*
* Manages physical address maps.
@@ -1732,7 +1732,10 @@
PV_STAT(pv_entry_allocs++);
pv_entry_count++;
if (pv_entry_count > pv_entry_high_water)
- pagedaemon_wakeup();
+ if (ratecheck(&lastprint, &printinterval))
+ printf("Approaching the limit on PV entries, consider "
+ "increasing either the vm.pmap.shpgperproc or the "
+ "vm.pmap.pv_entry_max sysctl.\n");
pc = TAILQ_FIRST(&pmap->pm_pvchunk);
if (pc != NULL) {
for (field = 0; field < _NPCM; field++) {
@@ -1767,10 +1770,6 @@
* pages. After that, if a pv chunk entry is still needed,
* destroy mappings to active pages.
*/
- if (ratecheck(&lastprint, &printinterval))
- printf("Approaching the limit on PV entries, consider "
- "increasing sysctl vm.pmap.shpgperproc or "
- "vm.pmap.pv_entry_max\n");
PV_STAT(pmap_collect_inactive++);
pmap_collect(pmap, &vm_page_queues[PQ_INACTIVE]);
m = vm_page_alloc(NULL, colour,
==== //depot/projects/zcopybpf/src/sys/dev/acpica/acpi_cpu.c#5 (text+ko) ====
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_cpu.c,v 1.67 2007/08/30 21:18:42 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_cpu.c,v 1.68 2007/11/02 17:29:36 njl Exp $");
#include "opt_acpi.h"
#include <sys/param.h>
@@ -501,12 +501,14 @@
/* Allow children to shutdown first. */
bus_generic_shutdown(dev);
- /* Disable any entry to the idle function. */
+ /*
+ * Disable any entry to the idle function. There is a small race where
+ * an idle thread have passed this check but not gone to sleep. This
+ * is ok since device_shutdown() does not free the softc, otherwise
+ * we'd have to be sure all threads were evicted before returning.
+ */
cpu_disable_idle = TRUE;
- /* Signal and wait for all processors to exit acpi_cpu_idle(). */
- smp_rendezvous(NULL, NULL, NULL, NULL);
-
return_VALUE (0);
}
==== //depot/projects/zcopybpf/src/sys/i386/conf/PAE#5 (text+ko) ====
@@ -1,7 +1,7 @@
#
# PAE -- Generic kernel configuration file for FreeBSD/i386 PAE
#
-# $FreeBSD: src/sys/i386/conf/PAE,v 1.26 2007/10/24 03:53:10 jhb Exp $
+# $FreeBSD: src/sys/i386/conf/PAE,v 1.27 2007/11/03 07:11:07 thompsa Exp $
include GENERIC
@@ -89,3 +89,4 @@
nodevice awi
nodevice ral
nodevice wi
+nodevice zyd # ZyDAS zb1211/zb1211b wireless NICs
==== //depot/projects/zcopybpf/src/sys/i386/i386/pmap.c#8 (text+ko) ====
@@ -75,7 +75,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.594 2007/08/21 04:59:34 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/i386/pmap.c,v 1.595 2007/11/03 05:15:26 alc Exp $");
/*
* Manages physical address maps.
@@ -1805,7 +1805,10 @@
PV_STAT(pv_entry_allocs++);
pv_entry_count++;
if (pv_entry_count > pv_entry_high_water)
- pagedaemon_wakeup();
+ if (ratecheck(&lastprint, &printinterval))
+ printf("Approaching the limit on PV entries, consider "
+ "increasing either the vm.pmap.shpgperproc or the "
+ "vm.pmap.pv_entry_max tunable.\n");
pc = TAILQ_FIRST(&pmap->pm_pvchunk);
if (pc != NULL) {
for (field = 0; field < _NPCM; field++) {
@@ -1851,11 +1854,6 @@
* inactive pages. After that, if a pv chunk entry
* is still needed, destroy mappings to active pages.
*/
- if (ratecheck(&lastprint, &printinterval))
- printf("Approaching the limit on PV entries, "
- "consider increasing tunables "
- "vm.pmap.shpgperproc or "
- "vm.pmap.pv_entry_max\n");
PV_STAT(pmap_collect_inactive++);
pmap_collect(pmap, &vm_page_queues[PQ_INACTIVE]);
if (m == NULL)
==== //depot/projects/zcopybpf/src/sys/kern/kern_fork.c#7 (text+ko) ====
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_fork.c,v 1.285 2007/10/24 19:03:54 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_fork.c,v 1.286 2007/11/02 19:40:36 julian Exp $");
#include "opt_ktrace.h"
#include "opt_mac.h"
@@ -208,7 +208,6 @@
* certain parts of a process from itself.
*/
if ((flags & RFPROC) == 0) {
-#if 0 /* XXX no other OS tries to do this */
if (((p1->p_flag & (P_HADTHREADS|P_SYSTEM)) == P_HADTHREADS) &&
(flags & (RFCFDG | RFFDG))) {
PROC_LOCK(p1);
@@ -218,7 +217,6 @@
}
PROC_UNLOCK(p1);
}
-#endif
vm_forkproc(td, NULL, NULL, flags);
@@ -238,49 +236,21 @@
if (flags & RFFDG)
fdunshare(p1, td);
-#if 0 /* XXX no other OS tries to do this */
if (((p1->p_flag & (P_HADTHREADS|P_SYSTEM)) == P_HADTHREADS) &&
(flags & (RFCFDG | RFFDG))) {
PROC_LOCK(p1);
thread_single_end();
PROC_UNLOCK(p1);
}
-#endif
*procp = NULL;
return (0);
}
-#if 0 /* XXX no other OS tries to do this */
/*
- * Note 1:1 allows for forking with one thread coming out on the
- * other side with the expectation that the process is about to
- * exec.
+ * XXX
+ * We did have single-threading code here
+ * however it proved un-needed and caused problems
*/
- if ((p1->p_flag & (P_HADTHREADS|P_SYSTEM)) == P_HADTHREADS) {
- /*
- * Systems processes don't need this.
- * Idle the other threads for a second.
- * Since the user space is copied, it must remain stable.
- * In addition, all threads (from the user perspective)
- * need to either be suspended or in the kernel,
- * where they will try restart in the parent and will
- * be aborted in the child.
- * keep threadds at the boundary there.
- */
- PROC_LOCK(p1);
- if (thread_single(SINGLE_BOUNDARY)) {
- /* Abort. Someone else is single threading before us. */
- PROC_UNLOCK(p1);
- return (ERESTART);
- }
- PROC_UNLOCK(p1);
- /*
- * All other activity in this process
- * is now suspended at the user boundary,
- * (or other safe places if we think of any).
- */
- }
-#endif
/* Allocate new proc. */
newproc = uma_zalloc(proc_zone, M_WAITOK);
@@ -729,18 +699,7 @@
msleep(p1, &p2->p_mtx, PWAIT, "ppwait", 0);
PROC_UNLOCK(p2);
-#if 0 /* XXX no other OS tries to do this */
/*
- * If other threads are waiting, let them continue now.
- */
- if ((p1->p_flag & (P_HADTHREADS|P_SYSTEM)) == P_HADTHREADS) {
- PROC_LOCK(p1);
- thread_single_end();
- PROC_UNLOCK(p1);
- }
-
-#endif
- /*
* Return child proc pointer to parent.
*/
*procp = p2;
@@ -755,11 +714,6 @@
mac_proc_destroy(newproc);
#endif
uma_zfree(proc_zone, newproc);
- if (p1->p_flag & P_HADTHREADS) {
- PROC_LOCK(p1);
- thread_single_end();
- PROC_UNLOCK(p1);
- }
pause("fork", hz / 2);
return (error);
}
==== //depot/projects/zcopybpf/src/sys/vm/swap_pager.c#7 (text+ko) ====
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/vm/swap_pager.c,v 1.296 2007/10/24 19:04:04 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/vm/swap_pager.c,v 1.297 2007/11/02 20:48:10 maxim Exp $");
#include "opt_mac.h"
#include "opt_swap.h"
@@ -1127,7 +1127,7 @@
int n = 0;
if (count && m[0]->object != object) {
- panic("swap_pager_getpages: object mismatch %p/%p",
+ panic("swap_pager_putpages: object mismatch %p/%p",
object,
m[0]->object
);
More information about the p4-projects
mailing list