Messages in this thread Patch in this message | | | From | Con Kolivas <> | Subject | [PATCH]O18.1int | Date | Sat, 23 Aug 2003 15:55:14 +1000 |
| |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Some high credit tasks were being missed due to their prolonged cpu burn at startup flagging them as low credit tasks.
Low credit tasks can now recover to become high credit.
Con -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQE/RwHDZUg7+tp6mRURAie7AJ43egdTeSapoX1D0aJQcEksBTkKdwCfcyHZ cD1TMt7oFNXvmSrqnJe7Z+E= =41zp -----END PGP SIGNATURE----- --- linux-2.6.0-test3-mm3-O18/kernel/sched.c 2003-08-23 15:28:47.000000000 +1000 +++ linux-2.6.0-test3-mm3/kernel/sched.c 2003-08-23 15:30:16.000000000 +1000 @@ -140,9 +140,6 @@ #define LOW_CREDIT(p) \ ((p)->interactive_credit < -MAX_SLEEP_AVG) -#define VARYING_CREDIT(p) \ - (!(HIGH_CREDIT(p) || LOW_CREDIT(p))) - #define TASK_PREEMPTS_CURR(p, rq) \ ((p)->prio < (rq)->curr->prio) @@ -434,7 +431,7 @@ static void recalc_task_prio(task_t *p, if (p->sleep_avg > NS_MAX_SLEEP_AVG){ p->sleep_avg = NS_MAX_SLEEP_AVG; - p->interactive_credit += VARYING_CREDIT(p); + p->interactive_credit += !(HIGH_CREDIT(p)); } } } @@ -1548,7 +1545,8 @@ switch_tasks: prev->sleep_avg -= run_time; if ((long)prev->sleep_avg <= 0){ prev->sleep_avg = 0; - prev->interactive_credit -= VARYING_CREDIT(prev); + prev->interactive_credit -= + !(HIGH_CREDIT(prev) || LOW_CREDIT(prev)); } prev->timestamp = now; | |