From owner-p4-projects@FreeBSD.ORG Fri Jun 11 01:05:13 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3446F16A4D1; Fri, 11 Jun 2004 01:05:13 +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 E75E816A4CE for ; Fri, 11 Jun 2004 01:05:12 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E006E43D1D for ; Fri, 11 Jun 2004 01:05:12 +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 i5B15Cj7057798 for ; Fri, 11 Jun 2004 01:05:12 GMT (envelope-from julian@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i5B15CDG057795 for perforce@freebsd.org; Fri, 11 Jun 2004 01:05:12 GMT (envelope-from julian@freebsd.org) Date: Fri, 11 Jun 2004 01:05:12 GMT Message-Id: <200406110105.i5B15CDG057795@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 54602 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 01:05:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=54602 Change 54602 by julian@julian_ref on 2004/06/11 01:04:35 compile Affected files ... .. //depot/projects/nsched/sys/kern/kern_kse.c#11 edit .. //depot/projects/nsched/sys/kern/kern_thread.c#20 edit Differences ... ==== //depot/projects/nsched/sys/kern/kern_kse.c#11 (text+ko) ==== @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -53,6 +52,7 @@ /* DEBUG ONLY */ extern int virtual_cpu; extern int thread_debug; + extern int max_threads_per_proc; extern int max_groups_per_proc; extern int max_threads_hits; @@ -67,48 +67,6 @@ 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) { @@ -1296,7 +1254,6 @@ return (error); /* go sync */ } -#if 0 int thread_upcall_check(struct thread *td) { @@ -1306,4 +1263,4 @@ else return (0); } -#endif + ==== //depot/projects/nsched/sys/kern/kern_thread.c#20 (text+ko) ==== @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -69,19 +70,43 @@ SYSCTL_INT(_kern_threads, OID_AUTO, max_threads_hits, CTLFLAG_RD, &max_threads_hits, 0, ""); +int virtual_cpu; +#define RANGEOF(type, start, end) (offsetof(type, end) - offsetof(type, start)) + TAILQ_HEAD(, thread) zombie_threads = TAILQ_HEAD_INITIALIZER(zombie_threads); TAILQ_HEAD(, ksegrp) zombie_ksegrps = TAILQ_HEAD_INITIALIZER(zombie_ksegrps); struct mtx kse_zombie_lock; MTX_SYSINIT(kse_zombie_lock, &kse_zombie_lock, "kse zombie lock", MTX_SPIN); -void kse_purge(struct proc *p, struct thread *td); -void kse_purge_group(struct thread *td); +static int +sysctl_kse_virtual_cpu(SYSCTL_HANDLER_ARGS) +{ + int error, new_val; + int def_val; -/* move to proc.h */ -extern void kseinit(void); -extern void kse_GC(void); +#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"); /* * Thread ID allocator. The allocator keeps track of assigned IDs by