Subject: Re: Changing the I/O scheduler on-the-fly
To: None <tech-kern@netbsd.org>
From: Juan RP <juan@xtrarom.org>
List: tech-kern
Date: 09/08/2005 00:39:00
On Wed, 7 Sep 2005 15:59:19 +0200
Juan RP <juan@xtrarom.org> wrote:

> TODO:
> 
> 	* Fix the buffers pending issue (where will go the previous
> 	   buffers? heh).
	^^^^^^^^^^
	NOT FIXED YET

> 
> 	* Add missing ioctl call to get the current I/O scheduler used
> 	  (DIOCGIOSCHED).
	^^^^^^^^^^^^
	IMPLEMENTED


New patch:

ftp://ftp.NetBSD.org/pub/NetBSD/misc/xtraeme/disk_scheduler_dkctl.diff

		^^^^
		I just added this ioctl.

Examples about its current state
---------------------------------------

To know all disk schedulers built in the kernel:

[juan@Nocturno][~]> sudo dkctl wd0 listschedulers
Available I/O disk schedulers:

fcfs            (First Come First Serve)
disksort        (Min Seek Sort)
readprio        (Min Seek Sort with read priority)
priocscan       (Per Priority Ciclycal Scan)
[juan@Nocturno][~]>

To know which one we are using on the drive:

[juan@Nocturno][~]> sudo dkctl wd0 getscheduler 
/dev/rwd0d: priocscan scheduler set
[juan@Nocturno][~]>

To set another disk scheduler on the drive:

[juan@Nocturno][~]> sudo dkctl wd0 setscheduler disksort
/dev/rwd0d: switched to disksort scheduler
[juan@Nocturno][~]>

[juan@Nocturno][~]> sudo dkctl wd0 getscheduler         
/dev/rwd0d: disksort scheduler set
[juan@Nocturno][~]>

Now there is only 1 item to fix, anyone want to help?

(Only the wd(4) and sd(4) drivers were modified, but modify other
ones will be really easy).