Skip to contentSkip to conversation

State of the CFQ scheduler

PATCH New David Nielsen 3 participants 6 messages Aug 28, 2003 – Aug 29, 2003 Block layer

lore
Share & tools
lore
#0 lore raw

What ever happened to Jens Axboe's CFQ scheduler - as a regular users I really enjoyed the CFQ scheduler as it made my desktop feel a bit smoother.

Is any work at all been done to this fine piece of code or has it been dropped completely in favor of AS ?

Regards
David Nielsen

Also, please CC me, I'm not on lkml.

#1 lore raw
Quoted 6 lines · David Nielsen

What ever happened to Jens Axboe's CFQ scheduler - as a regular users I really enjoyed the CFQ scheduler as it made my desktop feel a bit smoother.

Is any work at all been done to this fine piece of code or has it been dropped completely in favor of AS ?

I'm glad you enjoyed it. No CFQ hasn't been dropped, it was/is just on hold waiting for the loadable scheduler infrastructure. The reason for that is that I made lots of changes to that code base, not the old one that was in -mm.

It shouldn't be too hard to adapt the latest version from before -mm dropped it and adapting to the current kernels. If you want to give that a go, I'd be happy to help you out.

Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 3 lines · Jens Axboe

It shouldn't be too hard to adapt the latest version from before -mm dropped it and adapting to the current kernels. If you want to give that a go, I'd be happy to help you out.

Why don't you post a patch against 2.6.0-test4 or 2.6.0-test4-mm1 on LKML? I would like to start using CFQ again :-)

#3 lore raw
Quoted 8 lines · Felipe Alfaro Solana
Quoted 3 lines · Jens Axboe

It shouldn't be too hard to adapt the latest version from before -mm dropped it and adapting to the current kernels. If you want to give that a go, I'd be happy to help you out.

Why don't you post a patch against 2.6.0-test4 or 2.6.0-test4-mm1 on LKML? I would like to start using CFQ again :-)

Heh, did you not read the email? :)

I'll see if I get squeeze it in today, stay tuned.

Signature · 1 line
Jens Axboe
#4 lore raw

PATCH 1/1 2.6.0-test4 CFQ io scheduler

Quoted 7 lines · Jens Axboe
Quoted 6 lines · Felipe Alfaro Solana
Quoted 3 lines · Jens Axboe

It shouldn't be too hard to adapt the latest version from before -mm dropped it and adapting to the current kernels. If you want to give that a go, I'd be happy to help you out.

Quoted 6 lines
Quoted 2 lines

Why don't you post a patch against 2.6.0-test4 or 2.6.0-test4-mm1 on LKML? I would like to start using CFQ again :-)

Heh, did you not read the email? :)

I'll see if I get squeeze it in today, stay tuned.

Alright, here's a version for 2.6.0-test4. It builds, it survived a 128 client dbench on SMP. And that's all the testing I did, so be careful.

You need to boot with elevator=cfq to activate it.

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.1291 -> 1.1292
# include/linux/elevator.h 1.27 -> 1.28
# drivers/block/Kconfig.iosched 1.2 -> 1.3
# drivers/block/ll_rw_blk.c 1.206 -> 1.207
# drivers/block/Makefile 1.21 -> 1.22
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/08/29 [email protected] 1.1292
# CFQ I/O scheduler
# --------------------------------------------
#

drivers/block/Kconfig.iosched +7 -0
diff -Nru a/drivers/block/Kconfig.iosched b/drivers/block/Kconfig.iosched
@@ -27,3 +27,10 @@
 	  a disk at any one time, its behaviour is almost identical to the
 	  anticipatory I/O scheduler and so is a good choice.
 
+config IOSCHED_CFQ
+	bool "CFQ I/O scheduler" if EMBEDDED
+	default y
+	---help---
+	  The CFQ I/O scheduler tries to distribute bandwidth equally
+	  among all processes in the system. It should provide a fair
+	  working environment, suitable for desktop systems.
drivers/block/Makefile +1 -0
diff -Nru a/drivers/block/Makefile b/drivers/block/Makefile
@@ -18,6 +18,7 @@
 obj-$(CONFIG_IOSCHED_NOOP)	+= noop-iosched.o
 obj-$(CONFIG_IOSCHED_AS)	+= as-iosched.o
 obj-$(CONFIG_IOSCHED_DEADLINE)	+= deadline-iosched.o
+obj-$(CONFIG_IOSCHED_CFQ)	+= cfq-iosched.o
 obj-$(CONFIG_MAC_FLOPPY)	+= swim3.o
 obj-$(CONFIG_BLK_DEV_FD)	+= floppy.o
 obj-$(CONFIG_BLK_DEV_FD98)	+= floppy98.o
drivers/block/ll_rw_blk.c +6 -0
diff -Nru a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c
@@ -1231,6 +1231,8 @@
 	&iosched_as;
 #elif defined(CONFIG_IOSCHED_DEADLINE)
 	&iosched_deadline;
+#elif defined(CONFIG_IOSCHED_CFQ)
+	&iosched_cfq;
 #elif defined(CONFIG_IOSCHED_NOOP)
 	&elevator_noop;
 #else
@@ -1248,6 +1250,10 @@
 #ifdef CONFIG_IOSCHED_AS
 	if (!strcmp(str, "as"))
 		chosen_elevator = &iosched_as;
+#endif
+#ifdef CONFIG_IOSCHED_CFQ
+	if (!strcmp(str, "cfq"))
+		chosen_elevator = &iosched_cfq;
 #endif
 #ifdef CONFIG_IOSCHED_NOOP
 	if (!strcmp(str, "noop"))
include/linux/elevator.h +5 -0
diff -Nru a/include/linux/elevator.h b/include/linux/elevator.h
@@ -98,6 +98,11 @@
  */
 extern elevator_t iosched_as;
 
+/*
+ * completely fair queueing I/O scheduler
+ */
+extern elevator_t iosched_cfq;
+
 extern int elevator_init(request_queue_t *, elevator_t *);
 extern void elevator_exit(request_queue_t *);
 extern inline int elv_rq_merge_ok(struct request *, struct bio *);
drivers/block/cfq-iosched.c new file +690 -0

690 lines not on this page · raw message

Signature · 1 line
Jens Axboe
#5 lore raw
In reply to Jens Axboe
Quoted 8 lines · Jens Axboe
Quoted 6 lines
Quoted 3 lines

It shouldn't be too hard to adapt the latest version from before -mm dropped it and adapting to the current kernels. If you want to give that a go, I'd be happy to help you out.

Why don't you post a patch against 2.6.0-test4 or 2.6.0-test4-mm1 on LKML? I would like to start using CFQ again :-)

Heh, did you not read the email? :)

I just wanted you to know I really like CFQ :-)

Quoted 1 line

I'll see if I get squeeze it in today, stay tuned.

Yes, I will ;-)