Skip to contentSkip to conversation

I/O Request [Elevator; Clustering; Scatter-Gather]

DISCUSSION David Anderson 6 participants 7 messages Mar 4, 2003 SCSI

lore
Share & tools
lore
#0 lore raw

Hi,
I have been going through some documentation that talks of clustering, scatter-gather and elevator being used to improve performance. I am confused between these :

This is what I have understood :
Elevator
The job of the elevator is to sort I/O requests to disk drives in such a way that the disk head moving in the same direction for maximum performance. Have been able to locate the code for the same.

Clustering
Combines multiple requests to adjecent blocks into a single request. Have not been able to find the code which carries this out. Any clue on where this is done in the linux source code ??

Do Clustering of request and scatter-gather mean the same ?? Confused to the core... Kindly help me ...

Thanks and Regards,
David Anderson

Signature · 3 lines
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
#1 lore raw
Quoted 5 lines · David Anderson

Hi, I have been going through some documentation that talks of clustering, scatter-gather and elevator being used to improve performance. I am confused between these :

Quoted 8 lines

This is what I have understood : Elevator The job of the elevator is to sort I/O requests to disk drives in such a way that the disk head moving in the same direction for maximum performance. Have been able to locate the code for the same.

Clustering Combines multiple requests to adjecent blocks into a single request. Have not been able to find the code which carries this out. Any clue on where this is done in the linux source code ??

Both actions are performed by the elevator in Linux. You did not mention which kernel you are looking at, for 2.4 you need to read drivers/block/ll_rw_blk.c and drivers/block/elevator.c. For 2.5, read the same files and drivers/block/deadline-iosched.c in addition.

Quoted 2 lines

Do Clustering of request and scatter-gather mean the same ?? Confused to the core... Kindly help me ...

No, the elevator clustering refers to clustering request that are contigious on disk. Scatter-gather may cluster sg entries that are contigious in memory.

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

Do Clustering of request and scatter-gather mean the same ?? Confused to the core... Kindly help me ...

No, the elevator clustering refers to clustering request that are contigious on disk. Scatter-gather may cluster sg entries that are contigious in memory.

Hi Jens,

I think you meant to write *non*contiguous in memory (but contiguous on the device).

Regards,

Daniel

#3 lore raw
Quoted 4 lines · Daniel Phillips
Quoted 3 lines · Jens Axboe
Quoted 2 lines

Do Clustering of request and scatter-gather mean the same ?? Confused to the core... Kindly help me ...

Quoted 8 lines
Quoted 3 lines

No, the elevator clustering refers to clustering request that are contigious on disk. Scatter-gather may cluster sg entries that are contigious in memory.

Hi Jens,

I think you meant to write *non*contiguous in memory (but contiguous on the device).

No I didn't. Well actually both may happen, depending on your hardware. What I wrote covers basic x86 hardware.

Signature · 1 line
Jens Axboe
#4 lore raw
Quoted 6 lines
Quoted 6 lines

Scatter-gather may cluster sg entries that are

Quoted 1 line

contiguous in memory.

Please explain this function.

The only "scatter gather" I've heard of is the concept of a single I/O having a discontiguous buffer. If it's a write, the system gathers bytes from multiple separate buffers into a single write. If it's a read, the system scatters the bytes from a single read into multiple separate buffers.

The readv() and writev() system calls are examples of something that implements a scatter/gather function. (But not the scatter/gather function we're talking about here).

When you cluster disk I/O by combining separate requests that happen to be to adjacent disk locations, you must have a scatter/gather function somewhere (e.g. the disk controller or DMA controller) to make it work, because those requests probably don't have contiguous buffers.

#5 lore raw
Quoted 9 lines · Bryan Henderson
Quoted 6 lines
Quoted 6 lines

Scatter-gather may cluster sg entries that are

Quoted 1 line

contiguous in memory.

Please explain this function.

But, he did explain it.

Basically if you have two or more sg entries (vaguely a buffer address and buffer length) *and* they are contiguous in memory (tricky), i.e. (100,100), (200,100), (300,100), then a smart choice would be to make just a single sg entry (100,300). (This was just an example for illustratory puposes.)

For the other concepts, the book
"Operating System Concepts", Silberschatz & Galvin, Addison-Wesley, 1998, ISBN 0-201-59113-8, commonly referred to as ``the dinosaur book'' (because of the dinosaurs depicted on the cover) is a good start.

Quoted 19 lines

The only "scatter gather" I've heard of is the concept of a single I/O having a discontiguous buffer. If it's a write, the system gathers bytes from multiple separate buffers into a single write. If it's a read, the system scatters the bytes from a single read into multiple separate buffers.

The readv() and writev() system calls are examples of something that implements a scatter/gather function. (But not the scatter/gather function we're talking about here).

When you cluster disk I/O by combining separate requests that happen to be to adjacent disk locations, you must have a scatter/gather function somewhere (e.g. the disk controller or DMA controller) to make it work, because those requests probably don't have contiguous buffers.

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 1 line
Luben
#6 lore raw
In reply to David Anderson

My understanding ... which may be misguided ...

Elevator: If three different users post read requests for Logical Block #1, #32678, and #4 respectively then it will be more efficient to sort the requests and process them in the sequence #1, #4, #32678 as it minimizes the disk seeking time/distance.

Clustering: "Combines multiple requests to adjecent blocks into a single request". I am not personally familiar with if/where this is done in the SCSI subsystem, but sounds vaguely reasonable (if you have already sorted requests for "Elevator").

Scatter/Gather: In my experience, this refers to the ability of a low level adapter to "gather" multiple pieces of a single disk request which are located in different (non-contiguous) areas of physical memory. This is typically done with some type of memory mapping or a direct memory access (DMA) mechanism that can sequence through a list of blocks. Intuitively, it would seem that Scatter/Gather capability would be required to effectively implement "Clustering".

Hope this helps.

Regards, Scott.