mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
scheduler: implement nice
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
#define AUTH_ACTIONS_CRED_SETEGID 32
|
||||
|
||||
#define AUTH_ACTIONS_PROCESS_SIGNAL 1
|
||||
#define AUTH_ACTIONS_PROCESS_NICE 2
|
||||
|
||||
#define AUTH_ACTIONS_NETWORK_CONFIGURE 1
|
||||
#define AUTH_ACTIONS_NETWORK_BINDRESERVED 2
|
||||
|
||||
@@ -41,6 +41,7 @@ typedef struct proc_t {
|
||||
spinlock_t nodeslock;
|
||||
semaphore_t waitsem;
|
||||
spinlock_t exiting;
|
||||
int nice;
|
||||
|
||||
spinlock_t jobctllock;
|
||||
struct {
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
#define SCHED_RUN_QUEUE_SIZE 32
|
||||
#define SCHED_MAX_INTERACTIVITY 100
|
||||
#define SCHED_NICE_MAX 19
|
||||
#define SCHED_NICE_MIN -20
|
||||
|
||||
typedef struct {
|
||||
struct {
|
||||
|
||||
@@ -37,7 +37,6 @@ typedef struct thread_t {
|
||||
vmmcontext_t *vmmctx;
|
||||
tid_t tid;
|
||||
int flags;
|
||||
long priority;
|
||||
bool sleepintstatus;
|
||||
spinlock_t sleeplock;
|
||||
int wakeupreason;
|
||||
@@ -45,6 +44,7 @@ typedef struct thread_t {
|
||||
void *kernelarg;
|
||||
context_t *usercopyctx;
|
||||
int class;
|
||||
int nice;
|
||||
struct {
|
||||
spinlock_t lock;
|
||||
eventheader_t waitpendingevent;
|
||||
@@ -67,7 +67,7 @@ typedef struct thread_t {
|
||||
} thread_t;
|
||||
|
||||
__attribute__((noreturn)) void sched_threadexit();
|
||||
thread_t *sched_newthread(void *ip, size_t kstacksize, int priority, struct proc_t *proc, void *ustack);
|
||||
thread_t *sched_newthread(void *ip, size_t kstacksize, int nice, struct proc_t *proc, void *ustack);
|
||||
void sched_destroythread(thread_t *);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user