diff --git a/nomt/src/io/linux.rs b/nomt/src/io/linux.rs index b8c48fc9..c338a419 100644 --- a/nomt/src/io/linux.rs +++ b/nomt/src/io/linux.rs @@ -5,7 +5,7 @@ use slab::Slab; use std::collections::VecDeque; use threadpool::ThreadPool; -const RING_CAPACITY: u32 = 128; +const RING_CAPACITY: u32 = 1024; // max number of inflight requests is bounded by the slab. const MAX_IN_FLIGHT: usize = RING_CAPACITY as usize; @@ -19,12 +19,11 @@ pub fn start_io_worker( page_pool: PagePool, io_workers_tp: &ThreadPool, io_workers: usize, - iopoll: bool, ) -> Sender { // main bound is from the pending slab. let (command_tx, command_rx) = crossbeam_channel::unbounded(); - start_workers(page_pool, io_workers_tp, command_rx, io_workers, iopoll); + start_workers(page_pool, io_workers_tp, command_rx, io_workers); command_tx } @@ -34,25 +33,20 @@ fn start_workers( io_workers_tp: &ThreadPool, command_rx: Receiver, io_workers: usize, - iopoll: bool, ) { for _ in 0..io_workers { io_workers_tp.execute({ let page_pool = page_pool.clone(); let command_rx = command_rx.clone(); - move || run_worker(page_pool, command_rx, iopoll) + move || run_worker(page_pool, command_rx) }); } } -fn run_worker(page_pool: PagePool, command_rx: Receiver, iopoll: bool) { +fn run_worker(page_pool: PagePool, command_rx: Receiver) { let mut pending: Slab = Slab::with_capacity(MAX_IN_FLIGHT); - let mut ring_builder = IoUring::::builder(); - if iopoll { - ring_builder.setup_iopoll(); - } - let mut ring = ring_builder + let mut ring = IoUring::::builder() .build(RING_CAPACITY) .expect("Error building io_uring"); diff --git a/nomt/src/io/mod.rs b/nomt/src/io/mod.rs index ca532f6a..335526a9 100644 --- a/nomt/src/io/mod.rs +++ b/nomt/src/io/mod.rs @@ -102,9 +102,9 @@ struct IoPacket { /// Create an I/O worker managing an io_uring and sending responses back via channels to a number /// of handles. -pub fn start_io_pool(io_workers: usize, iopoll: bool, page_pool: PagePool) -> IoPool { +pub fn start_io_pool(io_workers: usize, page_pool: PagePool) -> IoPool { let io_workers_tp = ThreadPool::with_name("io-worker".to_string(), io_workers); - let sender = platform::start_io_worker(page_pool.clone(), &io_workers_tp, io_workers, iopoll); + let sender = platform::start_io_worker(page_pool.clone(), &io_workers_tp, io_workers); let sender = Some(Arc::new(sender)); IoPool { sender, @@ -115,7 +115,7 @@ pub fn start_io_pool(io_workers: usize, iopoll: bool, page_pool: PagePool) -> Io #[cfg(test)] pub fn start_test_io_pool(io_workers: usize, page_pool: PagePool) -> IoPool { - start_io_pool(io_workers, false, page_pool) + start_io_pool(io_workers, page_pool) } /// A manager for the broader I/O pool. This can be used to create new I/O handles. diff --git a/nomt/src/io/unix.rs b/nomt/src/io/unix.rs index 061104a4..9e713e7e 100644 --- a/nomt/src/io/unix.rs +++ b/nomt/src/io/unix.rs @@ -6,7 +6,6 @@ pub fn start_io_worker( page_pool: PagePool, io_workers_tp: &ThreadPool, io_workers: usize, - _iopoll: bool, ) -> Sender { let (command_tx, command_rx) = crossbeam_channel::unbounded(); diff --git a/nomt/src/store/mod.rs b/nomt/src/store/mod.rs index dc2975a6..0da2204b 100644 --- a/nomt/src/store/mod.rs +++ b/nomt/src/store/mod.rs @@ -70,26 +70,20 @@ impl Store { cfg_if::cfg_if! { if #[cfg(target_os = "linux")] { - // iopoll does not play nice with FUSE and tmpfs. A symptom is ENOSUPP. // O_DIRECT is not supported on tmpfs. - let iopoll: bool; let o_direct: bool; match crate::sys::linux::fs_check(&db_dir_fd) { Ok(fsck) => { - iopoll = !(fsck.is_fuse() || fsck.is_tmpfs()); o_direct = !fsck.is_tmpfs(); }, Err(_) => { - iopoll = false; o_direct = false; }, } - } else { - let iopoll = true; } } - let io_pool = io::start_io_pool(o.io_workers, iopoll, page_pool.clone()); + let io_pool = io::start_io_pool(o.io_workers, page_pool.clone()); let meta_fd = { let mut options = OpenOptions::new(); diff --git a/nomt/src/sys/linux.rs b/nomt/src/sys/linux.rs index c5eb5408..89622437 100644 --- a/nomt/src/sys/linux.rs +++ b/nomt/src/sys/linux.rs @@ -26,11 +26,6 @@ impl FsCheck { pub fn is_tmpfs(&self) -> bool { self.stat.f_type == libc::TMPFS_MAGIC } - - /// Returns true if the filesystem is backed by FUSE. - pub fn is_fuse(&self) -> bool { - self.stat.f_type == libc::FUSE_SUPER_MAGIC - } } /// fallocate changes the size of the file to the given length if it's less than the current size.