From: Ming Lei <[email protected]>
To: [email protected], [email protected]
Cc: [email protected], [email protected]
Subject: libublk-rs: v0.2 with async/await support
Date: Mon, 30 Oct 2023 11:20:36 +0800 [thread overview]
Message-ID: <ZT8hBFcmmHsw9cDY@fedora> (raw)
Hi,
libublk-rs v0.2 is released:
https://crates.io/crates/libublk
https://github.com/ming1/libublk-rs
Changes:
- support async/await for generic async fn(don't depend on runtime) and io_uring.
- unprivileged ublk
- queue idle handle
- almost all features in libublksrv are supported in libublk-rs now
- command line support for examples
Now each io command can be handled in dedicated io task as following,
and it looks like sync programming, but everything is handled in async
style:
let mut cmd_op = libublk::sys::UBLK_IO_FETCH_REQ;
let mut result = 0;
let addr = std::ptr::null_mut();
loop {
if q.submit_io_cmd(tag, cmd_op, addr, result).await
== libublk::sys::UBLK_IO_RES_ABORT
{
break;
}
// io_uring async is preferred
result = handle_io_cmd(&q, tag).await;
cmd_op = libublk::sys::UBLK_IO_COMMIT_AND_FETCH_REQ;
}
Roadmap:
1) write more complicated targets with async/await
- re-write qcow2 with clean async/await implementation in rublk project which
depends on libublk
https://crates.io/crates/rublk
https://github.com/ming1/rublk
2) tens of thousands of ublk device support
- switch control command to async/await, and make ublk device in one
thread with single blocking point
- shared task: one task can create multiple ublk devices
- shared uring: create multiple ublk device with single uring.
3) support tokio async, especially for non-io_uring target io handling
Thanks,
Ming
reply other threads:[~2023-10-30 3:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZT8hBFcmmHsw9cDY@fedora \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox