linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [RFC PATCH] block: Change default IO scheduler to deadline except SATA
@ 2012-04-10 17:44 Xose Vazquez Perez
  0 siblings, 0 replies; 18+ messages in thread
From: Xose Vazquez Perez @ 2012-04-10 17:44 UTC (permalink / raw)
  To: linux-kernel

Vivek Goyal wrote:

 > I am wondering if CFQ as default scheduler is still the right choice. CFQ
 > generally works well on slow rotational media (SATA?). But often
 > underperforms on faster storage (storage arrays, PCIE SSDs, virtualized
 > disk in linux guests etc). People often put logic in user space to tune their
 > systems and change IO scheduler to deadline to get better performance on
 > faster storage.
 >
 > Though there is not one good answer for all kind of storage and for all
 > kind of workloads, I am wondering if we can provide a better default and
 > that is change default IO scheduler to "deadline" except SATA.
 >
 > One can argue that some SAS disks can be slow too and benefit from CFQ. Yes,
 > but default IO scheduler choice is not perfect anyway. It just tries to
 > cater to a wide variety of use cases out of the box.
 >
 > So I am throwing this patch out see if it flies. Personally, I think it
 > might turn out to be a more reasonable default.

done time ago for dasd devices.

chuchi:~/curre/linux-2.6 $ grep -ri deadline drivers/s390/block/*
drivers/s390/block/dasd.c:      rc = elevator_init(block->request_queue, "deadline");
drivers/s390/block/Kconfig:     select IOSCHED_DEADLINE

^ permalink raw reply	[flat|nested] 18+ messages in thread
* [RFC PATCH] block: Change default IO scheduler to deadline except SATA
@ 2012-04-10 13:37 Vivek Goyal
  2012-04-10 13:56 ` Jens Axboe
  0 siblings, 1 reply; 18+ messages in thread
From: Vivek Goyal @ 2012-04-10 13:37 UTC (permalink / raw)
  To: linux kernel mailing list, Jens Axboe; +Cc: Moyer Jeff Moyer

Hi,

I am wondering if CFQ as default scheduler is still the right choice. CFQ
generally works well on slow rotational media (SATA?). But often
underperforms on faster storage (storage arrays, PCIE SSDs, virtualized
disk in linux guests etc). People often put logic in user space to tune their
systems and change IO scheduler to deadline to get better performance on
faster storage.

Though there is not one good answer for all kind of storage and for all
kind of workloads, I am wondering if we can provide a better default and
that is change default IO scheduler to "deadline" except SATA.

One can argue that some SAS disks can be slow too and benefit from CFQ. Yes,
but default IO scheduler choice is not perfect anyway. It just tries to
cater to a wide variety of use cases out of the box.

So I am throwing this patch out see if it flies. Personally, I think it
might turn out to be a more reasonable default.

Thanks
Vivek


Change default IO scheduler to deadline except SATA disks.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---
 block/Kconfig.iosched     |    2 +-
 block/elevator.c          |    2 +-
 drivers/ata/libata-scsi.c |    4 ++++
 include/linux/elevator.h  |    2 ++
 4 files changed, 8 insertions(+), 2 deletions(-)

Index: linux-2.6/block/Kconfig.iosched
===================================================================
--- linux-2.6.orig/block/Kconfig.iosched	2012-04-09 22:18:30.941885325 -0400
+++ linux-2.6/block/Kconfig.iosched	2012-04-09 22:18:51.982885971 -0400
@@ -45,7 +45,7 @@ config CFQ_GROUP_IOSCHED
 
 choice
 	prompt "Default I/O scheduler"
-	default DEFAULT_CFQ
+	default DEFAULT_DEADLINE
 	help
 	  Select the I/O scheduler which will be used by default for all
 	  block devices.
Index: linux-2.6/drivers/ata/libata-scsi.c
===================================================================
--- linux-2.6.orig/drivers/ata/libata-scsi.c	2012-04-09 22:18:30.946885325 -0400
+++ linux-2.6/drivers/ata/libata-scsi.c	2012-04-10 01:09:10.529292695 -0400
@@ -1146,6 +1146,10 @@ static int ata_scsi_dev_config(struct sc
 
 	blk_queue_flush_queueable(q, false);
 
+	/* Change IO scheduler to CFQ */
+	if (!(*chosen_elevator))
+		elevator_change(q, "cfq");
+
 	dev->sdev = sdev;
 	return 0;
 }
Index: linux-2.6/block/elevator.c
===================================================================
--- linux-2.6.orig/block/elevator.c	2012-04-09 22:18:30.000000000 -0400
+++ linux-2.6/block/elevator.c	2012-04-10 20:11:10.296866631 -0400
@@ -130,7 +130,7 @@ static int elevator_init_queue(struct re
 	return -ENOMEM;
 }
 
-static char chosen_elevator[ELV_NAME_MAX];
+char chosen_elevator[ELV_NAME_MAX];
 
 static int __init elevator_setup(char *str)
 {
Index: linux-2.6/include/linux/elevator.h
===================================================================
--- linux-2.6.orig/include/linux/elevator.h	2012-03-13 01:07:29.000000000 -0400
+++ linux-2.6/include/linux/elevator.h	2012-04-10 01:07:44.303289797 -0400
@@ -204,5 +204,7 @@ enum {
 	INIT_LIST_HEAD(&(rq)->csd.list);	\
 	} while (0)
 
+extern char chosen_elevator[];
+
 #endif /* CONFIG_BLOCK */
 #endif

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2012-04-11 16:25 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-10 17:44 [RFC PATCH] block: Change default IO scheduler to deadline except SATA Xose Vazquez Perez
  -- strict thread matches above, loose matches on Subject: below --
2012-04-10 13:37 Vivek Goyal
2012-04-10 13:56 ` Jens Axboe
2012-04-10 14:21   ` Vivek Goyal
2012-04-10 15:10     ` Vivek Goyal
2012-04-10 16:13       ` Mike Snitzer
2012-04-10 17:28         ` Vivek Goyal
2012-04-10 17:40           ` Mike Snitzer
2012-04-10 18:36         ` Jens Axboe
2012-04-11 16:25         ` Martin K. Petersen
2012-04-10 18:41       ` Jens Axboe
2012-04-10 18:53         ` Vivek Goyal
2012-04-10 18:56           ` Jens Axboe
2012-04-10 19:11             ` Vivek Goyal
2012-04-10 19:19               ` Jens Axboe
2012-04-10 19:43                 ` Mike Snitzer
2012-04-10 19:55                   ` Jens Axboe
2012-04-10 20:12                     ` Mike Snitzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).