-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DmaFile returns EOPNOTSUP when reading (error code 95) #605
Comments
You mean that this passes with tmpfs and btrfs? Or did you mean to imply the opposite by mistake? |
Correct. It passes with tmpfs and btrfs and the read fails everywhere else (writes are fine & I've verified using hexdump & breaking before we attempt the read that the file is materialized correctly) |
Ok. We manually disable TMPFS, so this is really just the file falling back to non-O_DIRECT. Code is:
I have no experience with BTRFS, so I don't really know what they support. I am very puzzled about the others, this seems like a run-of-the-mill write+read pattern with the most conservative buffer sizes possible. |
Is there any debugging tips you can share? I haven't figured out how to figure out why the kernel is responding in this way. |
I'd try to write the equivalent in C and take glommio out of the picture. This will tell you right away if this is a kernel issue. |
You don't happen to have a a basic C example handy do you? Is https://unixism.net/2020/04/io-uring-by-example-part-1-introduction/ a good starting point? |
thinking again, there's an even more basic thing that we can do, which is run the unit test suite from liburing. Reading the tests is also a great way to see a lot of examples in action. |
Haven't tried the repro yet, but one thing I've narrowed it down to is this only happens when the file is created and written to. Then reads start failing. If I touch the file first then read after write works fine. |
NVM. Must have been running the test code incorrectly. Read after write fails regardless of the positions/length as long as the file didn't exist prior to opening. @glommer this doesn't repro for you? |
Here's some test cases of initial write followed by a read. No pattern is immediately discernible for me. The last two test cases in particular seem fairly weird...
|
I just tried this on my old box, and I can't reproduce on either xfs nor ext4. |
https://gist.github.com/vlovich/9ab1bbb9b7c6081365c49b2ce35bf713 works. Not sure if that maps 1:1 with what's happening in glommio, but I have to imagine it's pretty close. @glommer does the C code look correct with respect to what glommio does internally? The relevant nuances for repro may be:
All this being said, I can't imagine how any of the details matter here. @glommer any tips on what to start debugging within glommio? |
take a look at src/sys/uring.rs, and inspect things right before they are put into their SQEs.
I am starting to think that maybe the buffers are not aligned somehow, and that's why we're getting this error? If you can - I'd try a similar thing without LUKS, and without LVM (between the two, I'd suspect LUKS more than LVM). |
I printed all the buffers used by |
Instrumented the kernel to get more insight. The line that's returning an error is this:
Also unclear why it has to be a new file followed by a write but otherwise it works. Not sure why running a very simple io_uring C program directly worked...
|
I'm sure I must be doing something wrong but I've been staring at this a few days and can't figure out what it might be. I'm consistently failing to read from DmaFile for some reason:
Here's the test:
Tested configurations:
Kernels tested:
6.5.4-1-MANJARO
6.5.4-2-ck
6.1.55-1-MANJARO
I've also tried pinning the test to P cores (13900K) in case that was some kind of issue
Will try a different kernel version & update shortly if this turns out to be some kind of kernel bug with io_uring + O_DIRECT.
The text was updated successfully, but these errors were encountered: