diff options
author | jake <jake@FreeBSD.org> | 2001-02-12 00:20:08 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2001-02-12 00:20:08 +0000 |
commit | 55d5108ac58bdc48fbd9eccefcb58a49682107b5 (patch) | |
tree | 2e0de19f9802474be1018e6086f4bb4e01fed0be /sys/sys/user.h | |
parent | 3acecaf2d523e3763f225a429b3007ff059b4253 (diff) | |
download | FreeBSD-src-55d5108ac58bdc48fbd9eccefcb58a49682107b5.zip FreeBSD-src-55d5108ac58bdc48fbd9eccefcb58a49682107b5.tar.gz |
Implement a unified run queue and adjust priority levels accordingly.
- All processes go into the same array of queues, with different
scheduling classes using different portions of the array. This
allows user processes to have their priorities propogated up into
interrupt thread range if need be.
- I chose 64 run queues as an arbitrary number that is greater than
32. We used to have 4 separate arrays of 32 queues each, so this
may not be optimal. The new run queue code was written with this
in mind; changing the number of run queues only requires changing
constants in runq.h and adjusting the priority levels.
- The new run queue code takes the run queue as a parameter. This
is intended to be used to create per-cpu run queues. Implement
wrappers for compatibility with the old interface which pass in
the global run queue structure.
- Group the priority level, user priority, native priority (before
propogation) and the scheduling class into a struct priority.
- Change any hard coded priority levels that I found to use
symbolic constants (TTIPRI and TTOPRI).
- Remove the curpriority global variable and use that of curproc.
This was used to detect when a process' priority had lowered and
it should yield. We now effectively yield on every interrupt.
- Activate propogate_priority(). It should now have the desired
effect without needing to also propogate the scheduling class.
- Temporarily comment out the call to vm_page_zero_idle() in the
idle loop. It interfered with propogate_priority() because
the idle process needed to do a non-blocking acquire of Giant
and then other processes would try to propogate their priority
onto it. The idle process should not do anything except idle.
vm_page_zero_idle() will return in the form of an idle priority
kernel thread which is woken up at apprioriate times by the vm
system.
- Update struct kinfo_proc to the new priority interface. Deliberately
change its size by adjusting the spare fields. It remained the same
size, but the layout has changed, so userland processes that use it
would parse the data incorrectly. The size constraint should really
be changed to an arbitrary version number. Also add a debug.sizeof
sysctl node for struct kinfo_proc.
Diffstat (limited to 'sys/sys/user.h')
-rw-r--r-- | sys/sys/user.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/sys/user.h b/sys/sys/user.h index 1f69bf9..7dac779 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -73,9 +73,9 @@ * fill_kinfo_proc and in lib/libkvm/kvm_proc.c in the function kvm_proclist. */ #ifdef __alpha__ -#define KINFO_PROC_SIZE 904 /* the correct size for kinfo_proc */ +#define KINFO_PROC_SIZE 912 /* the correct size for kinfo_proc */ #else -#define KINFO_PROC_SIZE 640 /* the correct size for kinfo_proc */ +#define KINFO_PROC_SIZE 644 /* the correct size for kinfo_proc */ #endif #define WMESGLEN 8 /* size of returned wchan message */ #define MTXNAMELEN 8 /* size of returned mutex name */ @@ -127,9 +127,6 @@ struct kinfo_proc { long ki_flag; /* P_* flags */ long ki_kiflag; /* KI_* flags (below) */ int ki_traceflag; /* Kernel trace points */ - u_char ki_priority; /* Process priority */ - u_char ki_usrpri; /* User-priority based on p_cpu */ - u_char ki_nativepri; /* Priority before propogation */ char ki_stat; /* S* process status */ char ki_nice; /* Process "nice" value */ char ki_lock; /* Process lock (prevent swap) count */ @@ -141,10 +138,10 @@ struct kinfo_proc { char ki_login[MAXLOGNAME+1]; /* setlogin name */ char ki_mtxname[MTXNAMELEN+1]; /* mutex name */ char ki_sparestrings[102]; /* spare string space */ - struct rtprio ki_rtprio; /* Realtime priority */ struct rusage ki_rusage; /* process rusage statistics */ long ki_sflag; /* PS_* flags */ - long ki_spare[24]; /* spare constants */ + struct priority ki_pri; /* process priority */ + long ki_spare[25]; /* spare constants */ }; void fill_kinfo_proc __P((struct proc *, struct kinfo_proc *)); |