rio icon indicating copy to clipboard operation
rio copied to clipboard

SQPOLL can not work in rio.

Open hidva opened this issue 4 years ago • 0 comments

I am currently transforming KuiBaDB into a fully asynchronous database, and want to use RIO as the underlying implementation of asynchronous IO.

But it seems that IORING_SETUP_SQPOLL can not work in RIO. RIO should also update Sq::ktail when IORING_SETUP_SQPOLL is enabled, but it doesn't. This causes the kernel to always think that there is no new SQE, which causes the Completion::wait() block forever.

fn main() {
    let mut cfg = rio::Config::default();
    cfg.sq_poll = true;
    let ring = cfg.start().expect("create uring");
    let file = std::fs::File::open("file").expect("openat");
    let data: &mut [u8] = &mut [0; 66];
    let completion = ring.read_at(&file, &data, 0);

    // if using threads
    completion.wait().unwrap();
}
[zhanyi@X rustplay]# /home/zhanyi/project/org/hidva.com/rustplay/target/debug/rustplay
^C  # block forever...

hidva avatar Sep 07 '21 07:09 hidva