* [RFC] [PATCH] use nice values in deadline IO scheduler
@ 2002-12-11 15:44 Charles Baylis
0 siblings, 0 replies; only message in thread
From: Charles Baylis @ 2002-12-11 15:44 UTC (permalink / raw)
To: linux-kernel
This untested patch uses the nice value of the current task to scale the
deadline for new read requests.
Does current contain a pointer to the task which caused the IO request at
this point? Is there any other reason why this might be a daft thing to do?
--- drivers/block/deadline-iosched.c~std 2002-12-11 14:33:48.000000000 +0000
+++ drivers/block/deadline-iosched.c 2002-12-11 15:17:58.000000000 +0000
@@ -17,6 +17,7 @@
#include <linux/init.h>
#include <linux/compiler.h>
#include <linux/hash.h>
+#include <linux/sched.h>
/*
* feel free to try other values :-). read_expire value is the timeout for
@@ -81,6 +82,19 @@ static kmem_cache_t *drq_pool;
#define RQ_DATA(rq) ((struct deadline_rq *) (rq)->elevator_private)
/*
+ * scale_deadline
+ */
+static int scale_deadline(int default_deadline)
+{
+ int prio = current->static_prio - MAX_RT_PRIO;
+ /* make priorities higher than nice -10 equal to nice -10 */
+ if (prio < 10)
+ prio = 10;
+ /* scale the deadline according to priority */
+ return default_deadline * prio/20;
+}
+
+/*
* rq hash
*/
static inline void __deadline_del_rq_hash(struct deadline_rq *drq)
@@ -440,7 +454,7 @@ deadline_add_request(request_queue_t *q,
/*
* set expire time and add to fifo list
*/
- drq->expires = jiffies + dd->read_expire;
+ drq->expires = jiffies + scale_deadline(dd->read_expire);
list_add_tail(&drq->fifo, &dd->read_fifo);
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-12-11 15:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-11 15:44 [RFC] [PATCH] use nice values in deadline IO scheduler Charles Baylis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®