kswapd's priority

Project BRAVO (bravo@russell.ce.uniroma2.it)
Wed, 24 Jun 1998 17:53:15 +0200


Does this code make sense ? It's from kswapd(), mm/vmscan.c (2.1.* and 2.0.*)

/* Give kswapd a realtime priority. */
current->policy = SCHED_FIFO;
current->priority = 32;

Looking at schedule() and goodness() in kernel/sched.c, the scheduling
algorithm does not consider 'counter' and 'priority' if the
'policy' of the task is different from SCHED_OTHER. Indeed in goodness()
we can find:

/*
* Realtime process, select the first one on the
* runqueue (taking priorities within processes
* into account).
*/
if (policy != SCHED_OTHER)
return 1000 + p->rt_priority;

Thus, I propose the following patch:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

--- vmscan.c.orig Wed Jun 24 18:43:04 1998
+++ vmscan.c Wed Jun 24 18:43:19 1998
@@ -532,7 +532,7 @@

/* Give kswapd a realtime priority. */
current->policy = SCHED_FIFO;
- current->priority = 32; /* Fixme --- we need to standardise our
+ current->rt_priority = 32; /* Fixme --- we need to standardise our
namings for POSIX.4 realtime scheduling
priorities. */

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Best regards,

Marco Cesati

+---------------------------------------------------------------+
| Computer Engineering - Project BRAVO |
+---------------------------------------------------------------+
| University of Rome "Tor Vergata" |
| Dept. of Computer Science, Systems and Industrial Engineering |
| via di Tor Vergata, 00133 Rome (Italy) |
| e-mail: bravo@russell.ce.uniroma2.it |
+---------------------------------------------------------------+

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu