This problem is about the scheduling policy.
I decided not to touch the process search policy
(i.e. scanning the list of RUNNING processes) and to
change the goodness() that is the score that a
process gets to run.
To take into account also the global amount of CPU used by a user i decided to use the struct user_struct * user field of the task_struct.
This is declared in kernel/fork.c and is explicitly said (include/linux/kernel/sched.h)
I add a new field analogous to the ticks counter of the task_struct, and a pointer to link all the user_struct together in a list (used for traversing them).
I also define the root for the list of user_struct's.
The "priority" for this counter is arbitrarily set to 50 for user tasks, and to 100 for tasks without users. I do not know if these values are appropriate. I just picked some value below 1000 (real-time processes goodness) and above zero.
I checked that the kernel boots and can do some tasks.
I did not do any extensive varification that there is no problem. Nor i did any performance evaluation. To this extent i can suggest