summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_synch.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2002-07-29 18:33:32 +0000
committerjulian <julian@FreeBSD.org>2002-07-29 18:33:32 +0000
commit6216c4b163409794825c784e02317143975376f3 (patch)
treefb17cadef050bebf8077e451640f625b2317869b /sys/kern/kern_synch.c
parent9f0ddc464e0c402f25ea8ae47e53ae9dba1c60c6 (diff)
downloadFreeBSD-src-6216c4b163409794825c784e02317143975376f3.zip
FreeBSD-src-6216c4b163409794825c784e02317143975376f3.tar.gz
Create a new thread state to describe threads that would be ready to run
except for the fact tha they are presently swapped out. Also add a process flag to indicate that the process has started the struggle to swap back in. This will be needed for the case where multiple threads start the swapin action top a collision. Also add code to stop a process fropm being swapped out if one of the threads in this process is actually off running on another CPU.. that might hurt... Submitted by: Seigo Tanimura <tanimura@r.dl.itc.u-tokyo.ac.jp>
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r--sys/kern/kern_synch.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index d553842..e4bef85 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -718,7 +718,7 @@ restart:
setrunqueue(td);
maybe_resched(td);
} else {
-/* XXXKSE Wrong! */ td->td_state = TDS_RUNQ;
+ td->td_state = TDS_SWAPPED;
p->p_sflag |= PS_SWAPINREQ;
wakeup(&proc0);
}
@@ -765,7 +765,7 @@ restart:
maybe_resched(td);
break;
} else {
-/* XXXKSE Wrong */ td->td_state = TDS_RUNQ;
+ td->td_state = TDS_SWAPPED;
p->p_sflag |= PS_SWAPINREQ;
wakeup(&proc0);
}
@@ -919,6 +919,7 @@ setrunnable(struct thread *td)
case 0:
case TDS_RUNNING:
case TDS_IWAIT:
+ case TDS_SWAPPED:
default:
printf("state is %d", td->td_state);
panic("setrunnable(2)");
@@ -939,7 +940,7 @@ setrunnable(struct thread *td)
updatepri(td);
td->td_ksegrp->kg_slptime = 0;
if ((p->p_sflag & PS_INMEM) == 0) {
- td->td_state = TDS_RUNQ; /* XXXKSE not a good idea */
+ td->td_state = TDS_SWAPPED;
p->p_sflag |= PS_SWAPINREQ;
wakeup(&proc0);
} else {
OpenPOWER on IntegriCloud