summaryrefslogtreecommitdiffstats
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2006-12-06 06:34:57 +0000
committerjulian <julian@FreeBSD.org>2006-12-06 06:34:57 +0000
commit396ed947f6606e1c43668a24471edd3bc2d2303a (patch)
treec0bf9a3a56052122c3c551fe189b4979f9bf745b /sys/kern/init_main.c
parenta5878e15cf129593dc7e00da508adbbd01fd98f0 (diff)
downloadFreeBSD-src-396ed947f6606e1c43668a24471edd3bc2d2303a.zip
FreeBSD-src-396ed947f6606e1c43668a24471edd3bc2d2303a.tar.gz
Threading cleanup.. part 2 of several.
Make part of John Birrell's KSE patch permanent.. Specifically, remove: Any reference of the ksegrp structure. This feature was never fully utilised and made things overly complicated. All code in the scheduler that tried to make threaded programs fair to unthreaded programs. Libpthread processes will already do this to some extent and libthr processes already disable it. Also: Since this makes such a big change to the scheduler(s), take the opportunity to rename some structures and elements that had to be moved anyhow. This makes the code a lot more readable. The ULE scheduler compiles again but I have no idea if it works. The 4bsd scheduler still reqires a little cleaning and some functions that now do ALMOST nothing will go away, but I thought I'd do that as a separate commit. Tested by David Xu, and Dan Eischen using libthr and libpthread.
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index d002a99..a911e11 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -95,9 +95,6 @@ static struct session session0;
static struct pgrp pgrp0;
struct proc proc0;
struct thread thread0 __aligned(8);
-#ifdef KSE
-struct ksegrp ksegrp0;
-#endif
struct vmspace vmspace0;
struct proc *initproc;
@@ -366,34 +363,16 @@ proc0_init(void *dummy __unused)
struct proc *p;
unsigned i;
struct thread *td;
-#ifdef KSE
- struct ksegrp *kg;
-#endif
GIANT_REQUIRED;
p = &proc0;
td = &thread0;
-#ifdef KSE
- kg = &ksegrp0;
-#endif
/*
* Initialize magic number.
*/
p->p_magic = P_MAGIC;
-#ifdef KSE
- /*
- * Initialize thread, process and ksegrp structures.
- */
- procinit(); /* set up proc zone */
- threadinit(); /* set up thead, upcall and KSEGRP zones */
-
- /*
- * Initialise scheduler resources.
- * Add scheduler specific parts to proc, ksegrp, thread as needed.
- */
-#else
/*
* Initialize thread and process structures.
*/
@@ -404,7 +383,6 @@ proc0_init(void *dummy __unused)
* Initialise scheduler resources.
* Add scheduler specific parts to proc, thread as needed.
*/
-#endif
schedinit(); /* scheduler gets its house in order */
/*
* Initialize sleep queue hash table
@@ -440,15 +418,9 @@ proc0_init(void *dummy __unused)
STAILQ_INIT(&p->p_ktr);
p->p_nice = NZERO;
td->td_state = TDS_RUNNING;
-#ifdef KSE
- kg->kg_pri_class = PRI_TIMESHARE;
- kg->kg_user_pri = PUSER;
- kg->kg_base_user_pri = PUSER;
-#else
td->td_pri_class = PRI_TIMESHARE;
td->td_user_pri = PUSER;
td->td_base_user_pri = PUSER;
-#endif
td->td_priority = PVM;
td->td_base_pri = PUSER;
td->td_oncpu = 0;
@@ -758,11 +730,7 @@ kick_init(const void *udata __unused)
td = FIRST_THREAD_IN_PROC(initproc);
mtx_lock_spin(&sched_lock);
TD_SET_CAN_RUN(td);
-#ifdef KSE
- setrunqueue(td, SRQ_BORING); /* XXXKSE */
-#else
setrunqueue(td, SRQ_BORING);
-#endif
mtx_unlock_spin(&sched_lock);
}
SYSINIT(kickinit, SI_SUB_KTHREAD_INIT, SI_ORDER_FIRST, kick_init, NULL)
OpenPOWER on IntegriCloud