All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Pavel Machek <pavel@ucw.cz>
Cc: cb-lkml@fish.zetnet.co.uk, kernel list <linux-kernel@vger.kernel.org>
Subject: Re: Disk priority dependend on nice level...
Date: Thu, 7 Aug 2003 01:40:36 +0200	[thread overview]
Message-ID: <20030806234036.GA209@elf.ucw.cz> (raw)
In-Reply-To: <20030806232810.GA1623@elf.ucw.cz>

Hi!

> I ported `subj` to 2.6.0-test2. I do not yet have idea if it works,
> but it compiles ;-).

It compiles, it event boots, but it does not seem to have much effect
:-(.

Test was like this:

bench:
#!/bin/bash
doit() {
    echo Unloaded system:
    time ./$1
    echo No nice:
    ./$1 loadonly &
    time ./$1
    killall $1
    killall bench_cat
    echo Nice -19:
    nice -n 19 ./$1 loadonly &
    time ./$1
    killall $1
    killall bench_cat
}

doit diskload


diskload:
#!/bin/bash
if [ "a$1" == aloadonly ]; then
	./bench_cat /usr/{bin,lib,lib/*}/* > /dev/null 2> /dev/null
	exit
fi
umount /suse
mount /suse
./bench_cat /suse/usr/bin/* > /dev/null 2> /dev/null


bench_cat is copy of /bin/cat.
									Pavel

> 
> --- clean/drivers/block/deadline-iosched.c	2003-07-27 22:31:10.000000000 +0200
> +++ linux/drivers/block/deadline-iosched.c	2003-08-07 01:26:47.000000000 +0200
> @@ -17,6 +17,7 @@
>  #include <linux/compiler.h>
>  #include <linux/hash.h>
>  #include <linux/rbtree.h>
> +#include <linux/sched.h>
>  
>  /*
>   * See Documentation/deadline-iosched.txt
> @@ -106,6 +107,19 @@
>  #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;
> +}
> +
> +/*
>   * the back merge hash support functions
>   */
>  static inline void __deadline_del_drq_hash(struct deadline_rq *drq)
> @@ -303,7 +317,7 @@
>  	/*
>  	 * set expire time (only used for reads) and add to fifo list
>  	 */
> -	drq->expires = jiffies + dd->fifo_expire[data_dir];
> +	drq->expires = jiffies + scale_deadline(dd->fifo_expire[data_dir]);
>  	list_add_tail(&drq->fifo, &dd->fifo_list[data_dir]);
>  }
>  
>  

-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

  reply	other threads:[~2003-08-06 23:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-06 23:28 Disk priority dependend on nice level Pavel Machek
2003-08-06 23:40 ` Pavel Machek [this message]
2003-08-07  8:02   ` Jens Axboe
2003-08-07  9:20     ` queue reference counting Nick Piggin
2003-08-07  9:22       ` Jens Axboe
2003-08-07  9:26         ` Nick Piggin
2003-08-07 10:04     ` Disk priority dependend on nice level Pavel Machek
2003-08-07 10:09       ` Jens Axboe
2003-08-07  5:57 ` Jens Axboe
2003-08-07 10:01   ` Pavel Machek
2003-08-07 10:09     ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030806234036.GA209@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=cb-lkml@fish.zetnet.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.