summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_glue.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/vm/vm_glue.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/vm/vm_glue.c')
-rw-r--r--sys/vm/vm_glue.c42
1 files changed, 3 insertions, 39 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index de56199..ff1d1ff 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -682,9 +682,6 @@ loop:
ppri = INT_MIN;
sx_slock(&allproc_lock);
FOREACH_PROC_IN_SYSTEM(p) {
-#ifdef KSE
- struct ksegrp *kg;
-#endif
if (p->p_sflag & (PS_INMEM | PS_SWAPPINGOUT | PS_SWAPPINGIN)) {
continue;
}
@@ -696,18 +693,13 @@ loop:
*
*/
if (td->td_inhibitors == TDI_SWAPPED) {
-#ifdef KSE
- kg = td->td_ksegrp;
- pri = p->p_swtime + kg->kg_slptime;
-#else
pri = p->p_swtime + td->td_slptime;
-#endif
if ((p->p_sflag & PS_SWAPINREQ) == 0) {
pri -= p->p_nice * 8;
}
/*
- * if this ksegrp/thread is higher priority
+ * if this thread is higher priority
* and there is enough space, then select
* this process instead of the previous
* selection.
@@ -816,9 +808,6 @@ int action;
{
struct proc *p;
struct thread *td;
-#ifdef KSE
- struct ksegrp *kg;
-#endif
int didswap = 0;
retry:
@@ -892,24 +881,15 @@ retry:
* do not swapout a realtime process
* Check all the thread groups..
*/
-#ifdef KSE
- FOREACH_KSEGRP_IN_PROC(p, kg) {
- if (PRI_IS_REALTIME(kg->kg_pri_class))
-#else
FOREACH_THREAD_IN_PROC(p, td) {
if (PRI_IS_REALTIME(td->td_pri_class))
-#endif
goto nextproc;
/*
* Guarantee swap_idle_threshold1
* time in memory.
*/
-#ifdef KSE
- if (kg->kg_slptime < swap_idle_threshold1)
-#else
if (td->td_slptime < swap_idle_threshold1)
-#endif
goto nextproc;
/*
@@ -921,16 +901,9 @@ retry:
* This could be refined to support
* swapping out a thread.
*/
-#ifdef KSE
- FOREACH_THREAD_IN_GROUP(kg, td) {
- if ((td->td_priority) < PSOCK ||
- !thread_safetoswapout(td))
- goto nextproc;
- }
-#else
- if ((td->td_priority) < PSOCK || !thread_safetoswapout(td))
+ if ((td->td_priority) < PSOCK ||
+ !thread_safetoswapout(td))
goto nextproc;
-#endif
/*
* If the system is under memory stress,
* or if we are swapping
@@ -939,20 +912,11 @@ retry:
*/
if (((action & VM_SWAP_NORMAL) == 0) &&
(((action & VM_SWAP_IDLE) == 0) ||
-#ifdef KSE
- (kg->kg_slptime < swap_idle_threshold2)))
-#else
(td->td_slptime < swap_idle_threshold2)))
-#endif
goto nextproc;
-#ifdef KSE
- if (minslptime > kg->kg_slptime)
- minslptime = kg->kg_slptime;
-#else
if (minslptime > td->td_slptime)
minslptime = td->td_slptime;
-#endif
}
/*
OpenPOWER on IntegriCloud