No need for a special idle queue
- as the idle task is never placed on any run queue, we don't need any special idle queue. - one more queue available for user processes
This commit is contained in:
parent
ad4dcaab71
commit
cb9faaebfd
3 changed files with 6 additions and 7 deletions
|
@ -1198,7 +1198,6 @@ register struct proc *rp; /* this process is now runnable */
|
|||
sched(rp, &q, &front);
|
||||
|
||||
vmassert(q >= 0);
|
||||
vmassert(q < IDLE_Q || rp->p_endpoint == IDLE);
|
||||
|
||||
/* Now add the process to the queue. */
|
||||
if (rdy_head[q] == NIL_PROC) { /* add to empty queue */
|
||||
|
@ -1262,7 +1261,6 @@ PRIVATE void enqueue_head(struct proc *rp)
|
|||
vmassert(rp->p_ticks_left);
|
||||
|
||||
vmassert(q >= 0);
|
||||
vmassert(q < IDLE_Q || rp->p_endpoint == IDLE);
|
||||
|
||||
q = rp->p_priority;
|
||||
|
||||
|
@ -1358,7 +1356,7 @@ int *front; /* return: front or back */
|
|||
*/
|
||||
if (! time_left) { /* quantum consumed ? */
|
||||
rp->p_ticks_left = rp->p_quantum_size; /* give new quantum */
|
||||
if (rp->p_priority < (IDLE_Q-1)) {
|
||||
if (rp->p_priority < (NR_SCHED_QUEUES-1)) {
|
||||
rp->p_priority += 1; /* lower priority */
|
||||
}
|
||||
}
|
||||
|
|
|
@ -223,9 +223,10 @@ struct proc {
|
|||
#define NR_SCHED_QUEUES 16 /* MUST equal minimum priority + 1 */
|
||||
#define TASK_Q 0 /* highest, used for kernel tasks */
|
||||
#define MAX_USER_Q 0 /* highest priority for user processes */
|
||||
#define USER_Q 7 /* default (should correspond to nice 0) */
|
||||
#define MIN_USER_Q 14 /* minimum priority for user processes */
|
||||
#define IDLE_Q 15 /* lowest, only IDLE process goes here */
|
||||
#define USER_Q (NR_SCHED_QUEUES / 2) /* default (should correspond to
|
||||
nice 0) */
|
||||
#define MIN_USER_Q (NR_SCHED_QUEUES - 1) /* minimum priority for user
|
||||
processes */
|
||||
|
||||
/* Magic process table addresses. */
|
||||
#define BEG_PROC_ADDR (&proc[0])
|
||||
|
|
|
@ -120,7 +120,7 @@ PRIVATE int
|
|||
|
||||
PUBLIC struct boot_image image[] = {
|
||||
/* process nr, pc,flags, qs, queue, stack, traps, ipcto, call, name */
|
||||
{IDLE, NULL,IDL_F, 0, IDLE_Q, IDL_S, 0, 0, no_c,"idle" },
|
||||
{IDLE, NULL,IDL_F, 0, 0, IDL_S, 0, 0, no_c,"idle" },
|
||||
{CLOCK,clock_task,TSK_F, 8, TASK_Q, TSK_S, TSK_T, 0, no_c,"clock" },
|
||||
{SYSTEM, sys_task,TSK_F, 8, TASK_Q, TSK_S, TSK_T, 0, no_c,"system"},
|
||||
{HARDWARE, 0,TSK_F, 8, TASK_Q, HRD_S, 0, 0, no_c,"kernel"},
|
||||
|
|
Loading…
Reference in a new issue