Replies: 5 comments 8 replies
-
Hello!
ublksrv is one userspace, and interface doc can be found in https://docs.kernel.org/block/ublk.html Also the following introduction slide may be helpful for you too: https://github.com/ming1/ubdsrv/blob/master/doc/ublk_intro.pdf
cmd_op 32 is UBLK_IO_FETCH_REQ, tag 96 is used, which means the
The 2nd 4k READ io completed, which is triggered by above io command
The 3rd 4k READ io, same with above, io command tag is 0.
io_uring_submit_and_wait_timeout() returns after 10sec timeout, even though
Since you are running ublksrv as root user, kernel will read the 1st 4k for But there are 3 4k READs, I guess there maybe someone which read data In my environment, I can just see one 4k READ when starting ublk loop. If you install bpftrace, the following script can help you find who #!/usr/bin/bpftrace #ifndef BPFTRACE_HAVE_BTF BEGIN kprobe:ublk_queue_rq
} |
Beta Was this translation helpful? Give feedback.
-
Hello @ming1. Running the given bpftrace program and
The process with PID=69 is Also I have noticed that each time I'm running let say
I'm not sure why it does so. If you have any explanation I'll will like to hear it! Also, if you have any other bpftrace program that you use, and helps you understand better the whole procedure you can share it if you like! Thanks! |
Beta Was this translation helpful? Give feedback.
-
OK, tracing ublk_queue_rq() is useless here, please use the following script =======submit.bt========== #!/usr/bin/bpftrace #ifndef BPFTRACE_HAVE_BTF kprobe:submit_bio
} |
Beta Was this translation helpful? Give feedback.
-
With the new script the output is:
So it seems that it an io_uring worker [I suppose this is the Furthermore, do you have any idea what is this is read stands for, when I run
|
Beta Was this translation helpful? Give feedback.
-
Yeah, the three read is for checking partition table: (ultrix_partition, amiga_partition and adfspart_check_ICS). |
Beta Was this translation helpful? Give feedback.
-
Hello!
I'm looking into this project as a part of my thesis, and I find it very fascinating.
However, I do have some questions, so I'll post them here and welcome any assistance.
Additionally, I should point out that I'm far from a "kernel expert," so please be patient!
Let's say that I run
./ublk add -t loop -f <file>
.In the messages shown bellow I have kept only the logs before
io_uring_submit_and_wait_timeout()
inublksrv_process_io()
, and the the log message inublksrv_handle_cqe()
because I want to understand exactly what sqes we are submitting and what responses we get via cqe.So the messages are like:
Can anyone guide me through these requests?
I get that the first message is before the first submission to the ring. We submit
q_depth
sqes to inform the driver about our buffers etc. Driver runsq_depth
times thecase [UBLK_IO_FETCH_REQ]
inublk_ch_uring_cmd()
. Then it initiates the/dev/ublkbN
and now we are ready to receive read/write requests.I don't get why we return from the
io_uring_submit_and_wait_timeout()
if there is no read/write request yet from user.I was expecting that after the first submission with the
q_depth
sqes, ublksrv will wait until a user performs a read/write request. Then driver will take care of the request from the block layer in theublk_queue_rq()
and eventually complete a cqe to notify ublksrv.Also from the messages above I get that there are two requests to the target for read. Why? Why do we "hit" the target if there is no user that read/writes to the target yet?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions