scheduler: implement nice

This commit is contained in:
Matheus
2025-08-21 20:46:06 -03:00
parent 3cf396393a
commit dbebef0e03
12 changed files with 89 additions and 32 deletions
+1
View File
@@ -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
+1
View File
@@ -41,6 +41,7 @@ typedef struct proc_t {
spinlock_t nodeslock;
semaphore_t waitsem;
spinlock_t exiting;
int nice;
spinlock_t jobctllock;
struct {
+2
View File
@@ -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 {
+2 -2
View File
@@ -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