From owner-p4-projects@FreeBSD.ORG Fri Jun 11 00:21:22 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4574616A4D1; Fri, 11 Jun 2004 00:21:22 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1EFEA16A4CE for ; Fri, 11 Jun 2004 00:21:22 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0062143D53 for ; Fri, 11 Jun 2004 00:21:22 +0000 (GMT) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i5B0LIk3041465 for ; Fri, 11 Jun 2004 00:21:18 GMT (envelope-from julian@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i5B0LIdd041398 for perforce@freebsd.org; Fri, 11 Jun 2004 00:21:18 GMT (envelope-from julian@freebsd.org) Date: Fri, 11 Jun 2004 00:21:18 GMT Message-Id: <200406110021.i5B0LIdd041398@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to julian@freebsd.org using -f From: Julian Elischer To: Perforce Change Reviews Subject: PERFORCE change 54600 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jun 2004 00:21:23 -0000 http://perforce.freebsd.org/chv.cgi?CH=54600 Change 54600 by julian@julian_ref on 2004/06/11 00:21:14 Merging in from -current Affected files ... .. //depot/projects/nsched/sys/kern/kern_kse.c#10 edit Differences ... ==== //depot/projects/nsched/sys/kern/kern_kse.c#10 (text+ko) ==== @@ -27,38 +27,23 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_thread.c,v 1.175 2004/04/03 15:59:12 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_kse.c,v 1.180 2004/06/07 07:26:53 julian Exp $"); #include #include #include #include -#include #include #include #include #include #include -#include #include #include #include -#include -#include -#include -#include #include #include -#include - -#include -#include -#include -#include #include -#include - -#include /* * KSEGRP related storage. @@ -74,7 +59,6 @@ extern struct mtx kse_zombie_lock; - #define RANGEOF(type, start, end) (offsetof(type, end) - offsetof(type, start)) TAILQ_HEAD(, kse_upcall) zombie_upcalls = @@ -83,7 +67,48 @@ static int thread_update_usr_ticks(struct thread *td, int user); static void thread_alloc_spare(struct thread *td, struct thread *spare); +#if 0 +/* move to proc.h */ +extern void kse_purge(struct proc *p, struct thread *td); +extern void kse_purge_group(struct thread *td); +void kseinit(void); +void kse_GC(void); + +static int virtual_cpu; +SYSCTL_DECL(_kern_threads); +static int +sysctl_kse_virtual_cpu(SYSCTL_HANDLER_ARGS) +{ + int error, new_val; + int def_val; + +#ifdef SMP + def_val = mp_ncpus; +#else + def_val = 1; +#endif + if (virtual_cpu == 0) + new_val = def_val; + else + new_val = virtual_cpu; + error = sysctl_handle_int(oidp, &new_val, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + if (new_val < 0) + return (EINVAL); + virtual_cpu = new_val; + return (0); +} + +/* DEBUG ONLY */ +SYSCTL_PROC(_kern_threads, OID_AUTO, virtual_cpu, CTLTYPE_INT|CTLFLAG_RW, + 0, sizeof(virtual_cpu), sysctl_kse_virtual_cpu, "I", + "debug virtual cpus"); + + +#endif + struct kse_upcall * upcall_alloc(void) { @@ -873,7 +898,6 @@ return (0); } - /* * This function is intended to be used to initialize a spare thread * for upcall. Initialize thread's large data area outside sched_lock @@ -1272,3 +1296,14 @@ return (error); /* go sync */ } +#if 0 +int +thread_upcall_check(struct thread *td) +{ + PROC_LOCK_ASSERT(td->td_proc, MA_OWNED); + if (td->td_kflags & TDK_WAKEUP) + return (1); + else + return (0); +} +#endif