From owner-p4-projects@FreeBSD.ORG Sat Nov 3 13:51:32 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A164C16A421; Sat, 3 Nov 2007 13:51:32 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AA5516A41B for ; Sat, 3 Nov 2007 13:51:32 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 36F1113C494 for ; Sat, 3 Nov 2007 13:51:32 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lA3DpWrQ029447 for ; Sat, 3 Nov 2007 13:51:32 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lA3DpWqt029444 for perforce@freebsd.org; Sat, 3 Nov 2007 13:51:32 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 3 Nov 2007 13:51:32 GMT Message-Id: <200711031351.lA3DpWqt029444@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 128553 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2007 13:51:33 -0000 http://perforce.freebsd.org/chv.cgi?CH=128553 Change 128553 by rwatson@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 -__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 -__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 @@ -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 -__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 -__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 -__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 );