-
Notifications
You must be signed in to change notification settings - Fork 139
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
Make block size configurable for SPT #315
Conversation
Signed-off-by: Ricardo Koller <[email protected]>
Signed-off-by: Ricardo Koller <[email protected]>
What you're actually asking for here is "Enable block operations for >1 block".
The underlying block size is a minimum I/O unit, which should eventually be detected by the tenders (using some ioctl which I don't remember right now). The user should not need to ever touch this manually. Same goes for the
This (I/O in multiples of minimum block size) is the correct way forward, however needs to be done carefully due to several reasons:
If this is for a FOSDEM demo then I'd suggest either hacking rumprun to use a smaller block size, or demoing with IncludeOS instead. Will discuss with you OOB. In summary: Right now I'd leave things as they are (as there's a risk of breaking what works), file an issue and then subject the block API to a proper review, including things like adding barriers/fsync. Does that make sense? /cc @cfcs |
|
@mato: will create an issue about improving the solo5 block interface: increase @mato and @cfcs: I realize that I added a lot of confusion by talking about FS Was thinking about this, and also trying some stuff in a Linux box to clear my FSes are optimized to make large IO requests. One way of doing so is by The underlying disk is addressable in disk blocks (aka sectors), and accessed As an example, this data is from an SSD in Linux. This SSD defines sectors in
Regarding atomicity guarantees for writes. Still not sure what are all the FSes [0] https://lwn.net/Articles/322777/ |
Aligned writes of physical sector size in direct IO mode are atomic (on most functional hardware, but idk if eg tape devices work that way). Our aligned writes of physical sector size are not guaranteed to be atomic, even if they happen to be most of the time. For instance we don't consider Anyway, I still don't really understand what the implementation of this
I found this article helpful to explain a bit of what is going on under the hood: Interestingly it helped correct my assumption that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Adding a dummy review here, as this has turned into a discussion about the block API, and the proposed change is not part of that. There should be a way to convert a PR into an issue.)
Moving the discussion to #325 |
Make block size configurable for SPT. This is desirable when the FS does IO in blocks larger than the current 512 Bytes. Having this issue in rumprun; IncludeOS is not an issue at the moment as only fat is supported (which uses 512B blocks as default). Other FSes default to different block sizes, like ISOFS to 2048, ext2 to 1024, and LFS to 4096. Splitting the FS IO in pieces is not efficient, and makes handling consistency a pain (like when just a piece of a large write fails).
Ideally, would like to pass the block size as an argument (like
--disk=abc --bsize=1024
), but I'm guessing that's not a very good idea for security reasons. Instead, this suggested change sets block size at compilation time. The idea would be to build solo5 like this:SPT_EXTRA_CFLAGS=-DSPT_BLOCK_SIZE=2048 make
.Alternatively, could also relax the block size checks (in the bindings and tenders) to only multiples of block size. This would be by far the easiest option, but not sure if it's the safest.