Skip to contentSkip to conversation

questions about the block backend/frontend driver

DISCUSSION Yuming fang 2 participants 4 messages Sep 8, 2008 – Sep 11, 2008

lore
Share & tools
lore
#0 lore raw

Hi, Everyone,

I am trying to understand the code of the block backend/frontend driver. I konw the blkback and blkfront communicate with each other through event channel and buffer ring. But there are some questions I could not understand.

1. When dom0 receive one disk request from domU1 and another disk request from domU2 simultaneously, how these two disk requests are pushed into Linux Kernel I/O Scheduler? How the Xen sort them before pushing them into the Linux Kernel I/O Scheduler?

2. Is there a disk request queue in the Xen to hold these disk requests, so that the Xen could only push the disk requests in the queue into the linux kernel I/O Scheduler?

I would appreciate it very much if anyone could give me some help.

Yuming

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Nobody answer these questions? I want to know if I could implement the I/O disk scheduling in Xen and then I could not modify the corresponding code(I/O Scheduling algorithms) of Linux Kernel?

Yuming

2008/9/8 Yuming fang <[email protected]>

Quoted 12 lines

Hi, Everyone,

I am trying to understand the code of the block backend/frontend driver. I konw the blkback and blkfront communicate with each other through event channel and buffer ring. But there are some questions I could not understand.

1. When dom0 receive one disk request from domU1 and another disk request from domU2 simultaneously, how these two disk requests are pushed into Linux Kernel I/O Scheduler? How the Xen sort them before pushing them into the Linux Kernel I/O Scheduler?

Quoted 9 lines

2. Is there a disk request queue in the Xen to hold these disk requests, so that the Xen could only push the disk requests in the queue into the linux kernel I/O Scheduler?

I would appreciate it very much if anyone could give me some help.

Yuming

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 3 lines · Yuming fang

Nobody answer these questions? I want to know if I could implement the I/O disk scheduling in Xen and then I could not modify the corresponding code(I/O Scheduling algorithms) of Linux Kernel?

I would recommend you get 'blktrace' programs and run them under Dom0 to get a practical answer to your question.

Quoted 16 lines

Yuming

2008/9/8 Yuming fang <[email protected]>

Quoted 11 lines

Hi, Everyone,

I am trying to understand the code of the block backend/frontend driver. I konw the blkback and blkfront communicate with each other through event channel and buffer ring. But there are some questions I could not understand.

1. When dom0 receive one disk request from domU1 and another disk request from domU2 simultaneously, how these two disk requests are pushed into Linux Kernel I/O Scheduler? How the Xen sort them before pushing them into the Linux Kernel I/O Scheduler?

That depends on which elevator you have. Xen does not sort them, just issues a bio request.

Quoted 4 lines
Quoted 4 lines

2. Is there a disk request queue in the Xen to hold these disk requests, so that the Xen could only push the disk requests in the queue into the linux kernel I/O Scheduler?

No. It uses the block devices queue to submit requests,

Quoted 11 lines
Quoted 6 lines

I would appreciate it very much if anyone could give me some help.

Yuming

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw

Thank you very much for your reply. 2008/9/9 Konrad Rzeszutek <[email protected]>

Quoted 9 lines · Yuming fang
Quoted 1 line

Nobody answer these questions? I want to know if I could implement the

I/O

Quoted 2 lines

disk scheduling in Xen and then I could not modify the corresponding code(I/O Scheduling algorithms) of Linux Kernel?

I would recommend you get 'blktrace' programs and run them under Dom0 to get a practical answer to your question.

I run the blktrace programs and could get the detailed information of disk I/O read/write requests. However, the blktrace is a tool which provides detailed information about request queue operations to the user space.

Quoted 8 lines

Yuming

2008/9/8 Yuming fang <[email protected]>

Quoted 3 lines

Hi, Everyone,

I am trying to understand the code of the block backend/frontend driver.

I

Quoted 5 lines
Quoted 5 lines

konw the blkback and blkfront communicate with each other through event channel and buffer ring. But there are some questions I could not understand.

1. When dom0 receive one disk request from domU1 and another disk

request

Quoted 1 line
Quoted 1 line

from domU2 simultaneously, how these two disk requests are pushed into

Linux

Quoted 2 lines
Quoted 2 lines

Kernel I/O Scheduler? How the Xen sort them before pushing them into the Linux Kernel I/O Scheduler?

That depends on which elevator you have. Xen does not sort them, just issues

Quoted 2 lines

a bio request.

Yeah, after your explanation, I read the code of blkback.c and understand some about it. In the Xen3.3 version, I find there is a \linux-2.6.18-xen-3.3.0\block\ directory, which includes the elevator.c, Linux I/O Scheduling algorithm files(cfq-iosched.c, deadline-iosched.c and so on). Do these files decide the disk I/O Scheduling Algorithm of the Linux-xen0? And if I want to add a different disk I/O Scheduling algorithm in Xen3.3, could I add it in this directory(linux-2.6.18-xen-3.3.0\linux-2.6.18-xen-3.3.0\block\)?

Quoted 10 lines
Quoted 3 lines
Quoted 3 lines

2. Is there a disk request queue in the Xen to hold these disk

requests, so

Quoted 1 line
Quoted 1 line

that the Xen could only push the disk requests in the queue into the

linux

Quoted 1 line
Quoted 1 line

kernel I/O Scheduler?

No. It uses the block devices queue to submit requests,

I think it uses the functions of unplug_queue(blkif_t *blkif) and plug_queue(blkif_t *blkif, struct bio *bio) (in \linux-2.6.18-xen-3.3.0\drivers\xen\blkback\blkback,.c) to process the requests. Is my explanation right?

Thanks
Yuming

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel