vhost_user_fs: add a flag to disable extended attributes

Extended attributes (xattr) support has a huge impact on write
performance. The reason for this is that, if enabled, FUSE sends a
setxattr request after each write operation, and due to the inode
locking inside the kernel during said request, the ability to execute
the operations in parallel becomes heavily limited.

Signed-off-by: Sergio Lopez <slp@redhat.com>
This commit is contained in:
Sergio Lopez
2020-03-12 15:22:06 +01:00
committed by Rob Bradford
parent 710520e9a1
commit 07cc73bddc
2 changed files with 31 additions and 0 deletions

View File

@@ -289,6 +289,11 @@ fn main() {
.takes_value(true)
.min_values(1),
)
.arg(
Arg::with_name("disable-xattr")
.long("disable-xattr")
.help("Disable support for extended attributes"),
)
.get_matches();
// Retrieve arguments
@@ -302,12 +307,14 @@ fn main() {
Some(size) => size.parse().expect("Invalid argument for thread-pool-size"),
None => THREAD_POOL_SIZE,
};
let xattr: bool = !cmd_arguments.is_present("disable-xattr");
// Convert into appropriate types
let sock = String::from(sock);
let fs_cfg = passthrough::Config {
root_dir: shared_dir.to_string(),
xattr,
..Default::default()
};
let fs = PassthroughFs::new(fs_cfg).unwrap();