Skip to contentSkip to conversation

I/O context isolation

2.6.6-mm4-ff1 FabF 3 participants 9 messages May 21, 2004 – May 22, 2004

Subsystems (2)
lore
Share & tools
lore

FabF

author
#0 lore raw

Jens,

Here's ff1 patchset to have generic I/O context.
ff1 : Export io context operations from blkdev/ll_rw_blk (ok) ff2 : Make io_context generic plateform by importing IO stuff from as_io.

AFAICS, cfq_queue for instance could disappear when using io_context
but I think elv_data should remain elevator side....
I don't want to go in the wild here so if you've got suggestions, don't hesitate ;)

Regards,
FabF

Changelog +5 -0
diff -Naur linux-2.6.6mm4/Changelog linux-2.6.6mm4ff1/Changelog
@@ -0,0 +1,5 @@
+2.6.6-mm4-ff1
+-------------
+Guideline : io/scheduler redesign
+
+> Extract io_context operations & ds from blkdev (FabF)
Makefile +1 -1
diff -Naur linux-2.6.6mm4/Makefile linux-2.6.6mm4ff1/Makefile
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 6
-EXTRAVERSION = -mm4
+EXTRAVERSION = -mm4ff1
 NAME=Zonked Quokka
 
 # *DOCUMENTATION*
Todo +4 -0
diff -Naur linux-2.6.6mm4/Todo linux-2.6.6mm4ff1/Todo
@@ -0,0 +1,4 @@
+
+< Extract as_io_context from blkdev.h
+< Documentation synch
+
drivers/block/Makefile +1 -1
diff -Naur linux-2.6.6mm4/drivers/block/Makefile linux-2.6.6mm4ff1/drivers/block/Makefile
@@ -13,7 +13,7 @@
 # kblockd threads
 #
 
-obj-y	:= elevator.o ll_rw_blk.o ioctl.o genhd.o scsi_ioctl.o
+obj-y	:= elevator.o io_context.o ll_rw_blk.o ioctl.o genhd.o scsi_ioctl.o
 
 obj-$(CONFIG_IOSCHED_NOOP)	+= noop-iosched.o
 obj-$(CONFIG_IOSCHED_AS)	+= as-iosched.o
drivers/block/as-iosched.c +1 -0
diff -Naur linux-2.6.6mm4/drivers/block/as-iosched.c linux-2.6.6mm4ff1/drivers/block/as-iosched.c
@@ -9,6 +9,7 @@
  */
 #include <linux/kernel.h>
 #include <linux/fs.h>
+#include <linux/io_context.h>
 #include <linux/blkdev.h>
 #include <linux/elevator.h>
 #include <linux/bio.h>
drivers/block/io_context.c +114 -0

114 lines not on this page · raw message

drivers/block/ll_rw_blk.c +2 -135

173 lines not on this page · raw message

include/linux/blkdev.h +2 -50

58 lines not on this page · raw message

include/linux/io_context.h +84 -0

84 lines not on this page · raw message

#1 lore raw
Quoted 7 lines · FabF

Jens,

Here's ff1 patchset to have generic I/O context.
ff1 : Export io context operations from blkdev/ll_rw_blk (ok) ff2 : Make io_context generic plateform by importing IO stuff from as_io.

Can I just ask why you want as_io_context in generic code? It is currently nicely hidden away in as-iosched.c where nobody else needs to ever see it.

Quoted 5 lines

AFAICS, cfq_queue for instance could disappear when using io_context
but I think elv_data should remain elevator side....
I don't want to go in the wild here so if you've got suggestions, don't hesitate ;)

cfq_queue is per-queue-per-process. io_context is just per-process, so it isn't a trivial replacement.

Nick

author
#2 lore raw
Quoted 9 lines · Nick Piggin
Quoted 7 lines · FabF

Jens,

Here's ff1 patchset to have generic I/O context.
ff1 : Export io context operations from blkdev/ll_rw_blk (ok) ff2 : Make io_context generic plateform by importing IO stuff from as_io.

Quoted 3 lines

Can I just ask why you want as_io_context in generic code? It is currently nicely hidden away in as-iosched.c where nobody else needs to ever see it.

I do want I/O context to be generic not the whole as_io. That export should bring:
-All elevators to use io_context -source tree to be more self-explanatory -have a stronger elevator interface

Quoted 9 lines
Quoted 6 lines

AFAICS, cfq_queue for instance could disappear when using io_context
but I think elv_data should remain elevator side....
I don't want to go in the wild here so if you've got suggestions, don't hesitate ;)

cfq_queue is per-queue-per-process. io_context is just per-process, so it isn't a trivial replacement.

But I guess we can merge that stuff to have "a one way, one place" code rather than repeat code in all elv.

Regards,
FabF

#3 lore raw
Quoted 10 lines · FabF
Quoted 9 lines · Nick Piggin
Quoted 7 lines · FabF

Jens,

Here's ff1 patchset to have generic I/O context.
ff1 : Export io context operations from blkdev/ll_rw_blk (ok) ff2 : Make io_context generic plateform by importing IO stuff from as_io.

Quoted 6 lines
Quoted 3 lines

Can I just ask why you want as_io_context in generic code? It is currently nicely hidden away in as-iosched.c where nobody else needs to ever see it.

I do want I/O context to be generic not the whole as_io. That export should bring:
-All elevators to use io_context

For?

Quoted 2 lines

-source tree to be more self-explanatory
-have a stronger elevator interface

Those aren't real arguments :-)

Quoted 10 lines
Quoted 8 lines
Quoted 5 lines

AFAICS, cfq_queue for instance could disappear when using io_context
but I think elv_data should remain elevator side....
I don't want to go in the wild here so if you've got suggestions, don't hesitate ;)

cfq_queue is per-queue-per-process. io_context is just per-process, so it isn't a trivial replacement.

But I guess we can merge that stuff to have "a one way, one place" code rather than repeat code in all elv.

That's another pit fall, don't design for a need that isn't there. Using io contexts in cfq does not get any easier with the code moved to iocontext.c file, it's fine where it is.

Signature · 1 line
Jens Axboe
author
#4 lore raw
Quoted 11 lines · Jens Axboe
Quoted 10 lines · FabF
Quoted 9 lines · Nick Piggin
Quoted 7 lines · FabF

Jens,

Here's ff1 patchset to have generic I/O context.
ff1 : Export io context operations from blkdev/ll_rw_blk (ok) ff2 : Make io_context generic plateform by importing IO stuff from as_io.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Can I just ask why you want as_io_context in generic code? It is currently nicely hidden away in as-iosched.c where nobody else needs to ever see it.

I do want I/O context to be generic not the whole as_io. That export should bring:
-All elevators to use io_context

For?

Well I was completely wrong :( ll_rw_blk uses i/o context all over the place so all elv do as well ... You're right Jens, the only good thing to do there would be to extract anticipation.

Regards,
FabF

#5 lore raw
In reply to FabF
Quoted 16 lines · FabF
Quoted 10 lines · Nick Piggin
Quoted 7 lines · FabF

Jens,

Here's ff1 patchset to have generic I/O context.
ff1 : Export io context operations from blkdev/ll_rw_blk (ok) ff2 : Make io_context generic plateform by importing IO stuff from as_io.

Quoted 3 lines

Can I just ask why you want as_io_context in generic code? It is currently nicely hidden away in as-iosched.c where nobody else needs to ever see it.

Quoted 6 lines

I do want I/O context to be generic not the whole as_io. That export should bring:
-All elevators to use io_context -source tree to be more self-explanatory -have a stronger elevator interface

Sorry, my mistake. as_io_context is not nicely hidden away at the moment. I can't remember why, I think it is only needed for the declaration... I'll look into moving it into as-iosched.c

*But*, io_context is already exported to all elevators and generic code.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

AFAICS, cfq_queue for instance could disappear when using io_context
but I think elv_data should remain elevator side....
I don't want to go in the wild here so if you've got suggestions, don't hesitate ;)

Quoted 6 lines
Quoted 2 lines

cfq_queue is per-queue-per-process. io_context is just per-process, so it isn't a trivial replacement.

But I guess we can merge that stuff to have "a one way, one place" code rather than repeat code in all elv.

I quite like things how they sit right now. The io_context thing is quite generic so that is fine... CFQ's cfq_queue is fairly specialised and trying to make it generic is not a very good idea, especially as no other elevators would make use of it.

author
#6 lore raw
Quoted 24 lines · Nick Piggin
Quoted 16 lines · FabF
Quoted 10 lines · Nick Piggin
Quoted 7 lines · FabF

Jens,

Here's ff1 patchset to have generic I/O context.
ff1 : Export io context operations from blkdev/ll_rw_blk (ok) ff2 : Make io_context generic plateform by importing IO stuff from as_io.

Quoted 3 lines

Can I just ask why you want as_io_context in generic code? It is currently nicely hidden away in as-iosched.c where nobody else needs to ever see it.

Quoted 6 lines

I do want I/O context to be generic not the whole as_io. That export should bring:
-All elevators to use io_context -source tree to be more self-explanatory -have a stronger elevator interface

Quoted 6 lines

Sorry, my mistake. as_io_context is not nicely hidden away at the moment. I can't remember why, I think it is only needed for the declaration... I'll look into moving it into as-iosched.c

*But*, io_context is already exported to all elevators and generic code.

Well ff1 does that "concept split".We have
-Elevator
-Elevator interface
-I/O context
-Block management

As none of you seems OK with further changes, I'll stop my effort right here but keep thinking ff1 is good :)

Regards,
FabF

#7 lore raw
In reply to Nick Piggin
Quoted 24 lines · Nick Piggin
Quoted 16 lines · FabF
Quoted 10 lines · Nick Piggin
Quoted 7 lines · FabF

Jens,

Here's ff1 patchset to have generic I/O context.
ff1 : Export io context operations from blkdev/ll_rw_blk (ok) ff2 : Make io_context generic plateform by importing IO stuff from as_io.

Quoted 3 lines

Can I just ask why you want as_io_context in generic code? It is currently nicely hidden away in as-iosched.c where nobody else needs to ever see it.

Quoted 6 lines

I do want I/O context to be generic not the whole as_io. That export should bring:
-All elevators to use io_context -source tree to be more self-explanatory -have a stronger elevator interface

Quoted 6 lines

Sorry, my mistake. as_io_context is not nicely hidden away at the moment. I can't remember why, I think it is only needed for the declaration... I'll look into moving it into as-iosched.c

*But*, io_context is already exported to all elevators and generic code.

That was my initial complaint about it as well, however solving it makes it even more ugly I think. It's a layering violation. I guess with a simply ->dtor and ->exit + io_private_data it would be fine, but I'd say don't bother now (it's 2.6.6).

Signature · 1 line
Jens Axboe
#8 lore raw
In reply to Nick Piggin
Quoted 9 lines · Nick Piggin
Quoted 7 lines · FabF

Jens,

Here's ff1 patchset to have generic I/O context.
ff1 : Export io context operations from blkdev/ll_rw_blk (ok) ff2 : Make io_context generic plateform by importing IO stuff from as_io.

Quoted 3 lines

Can I just ask why you want as_io_context in generic code? It is currently nicely hidden away in as-iosched.c where nobody else needs to ever see it.

I think (it's the only reason I can think of) that he is trying to make the anticipation generic. Am I correct?

Quoted 8 lines
Quoted 5 lines

AFAICS, cfq_queue for instance could disappear when using io_context
but I think elv_data should remain elevator side....
I don't want to go in the wild here so if you've got suggestions, don't hesitate ;)

cfq_queue is per-queue-per-process. io_context is just per-process, so it isn't a trivial replacement.

Definitely not, I struggled quite a bit with such a transformation in cfq + ioprio.

Signature · 1 line
Jens Axboe