Trying to rewrite the linux kernal to change RR scheduling

stonecold3169

Platinum Member
Jan 30, 2001
2,060
0
76
Hey all. First of all, I don't know if this belongs here or in OS, so I'm sorry if I'm wrong.

Basically, what I'm trying to do is change the default way that linux schedules tasks (in that all applications have even priority) so that if user A has 4 apps running, and user b has 1 running, that both user a and user b have teh same amount of scheduling, so in actuality user b's single app runs 4 times faster then each of A's 4 tasks.

So what I've done is made some changes in sched.h .

I added:

#define for_each_user(u)
for (u= &root_user; (u = u->next) != &root_user

Then, I changed in sched.c:

$define MY_UID 1000
#define MY_TICKS 0

asmlinkage void schedule (void)
{
int my_users = 0;
int my_ticks = 0;

struct user_struct * u;
struct tast_struct * p;
for_each_user(u){
if (u->uid > MY_UID) {
my_users++;
}
}

my_ticks = (NICE_TO_TICKS(MY_TICKS) * my_users);
for_each_task(p){
if (p->uid > MY_UID && p->euid > MY_UID) {
p->counter = (my_ticks/atomic_read(p->user->rpcesses));
}
}
}



I'm currently getting a compilation errors not on the atomic_read function, but with the p-> after it. Honestly, I can't find any problem with it. any ideas on what the issue might be? Please post any and all problems you can find in this!

Thanks in advance!
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Please don't cross-post, pick a forum and if it's wrong someone will tell you and (hopefully) move the thread.