Skip to content

Commit

Permalink
pageserver: implement aligned io buffer
Browse files Browse the repository at this point in the history
Signed-off-by: Yuchen Liang <[email protected]>
  • Loading branch information
yliang412 committed Oct 7, 2024
1 parent f1418ca commit 8bde188
Show file tree
Hide file tree
Showing 4 changed files with 420 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pageserver/src/virtual_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub(crate) use api::IoMode;
pub(crate) use io_engine::IoEngineKind;
pub(crate) use metadata::Metadata;
pub(crate) use open_options::*;
pub(crate) mod dio;

pub(crate) mod owned_buffers_io {
//! Abstractions for IO with owned buffers.
Expand All @@ -55,6 +56,7 @@ pub(crate) mod owned_buffers_io {
//! but for the time being we're proving out the primitives in the neon.git repo
//! for faster iteration.
pub(crate) mod io_buf_aligned;
pub(crate) mod io_buf_ext;
pub(crate) mod slice;
pub(crate) mod write;
Expand Down Expand Up @@ -1362,6 +1364,8 @@ pub(crate) const fn get_io_buffer_alignment() -> usize {
DEFAULT_IO_BUFFER_ALIGNMENT
}

pub(crate) type IoBufferMut = dio::AlignedBufferMut<{ get_io_buffer_alignment() }>;

static IO_MODE: AtomicU8 = AtomicU8::new(IoMode::preferred() as u8);

pub(crate) fn set_io_mode(mode: IoMode) {
Expand Down
Loading

0 comments on commit 8bde188

Please sign in to comment.