From f48ab8bcaabf61735cde17a4c3c38fa5471e9843 Mon Sep 17 00:00:00 2001 From: Yuchen Liang Date: Tue, 1 Oct 2024 03:57:58 +0000 Subject: [PATCH] use O_DIRECT as preferred Signed-off-by: Yuchen Liang --- libs/pageserver_api/src/models.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/pageserver_api/src/models.rs b/libs/pageserver_api/src/models.rs index 67da2783f5ca..b73fcc9d8303 100644 --- a/libs/pageserver_api/src/models.rs +++ b/libs/pageserver_api/src/models.rs @@ -1005,7 +1005,11 @@ pub mod virtual_file { impl IoMode { pub const fn preferred() -> Self { - Self::Buffered + if cfg!(target_os = "linux") { + Self::Direct + } else { + Self::Buffered + } } }