mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-30 20:06:52 -05:00
Add manual GC triggering + configurable process queue depth
Yes, these are unrelated changes but somehow ended up being prototyped together and I'm too lazy to separate them.
This commit is contained in:
parent
42836e0961
commit
5ab0fbcaee
27 changed files with 1439 additions and 342 deletions
|
|
@ -65,6 +65,7 @@ namespace l
|
|||
IFERT("pid");
|
||||
IFERT("pin-threads");
|
||||
IFERT("process-thread-count");
|
||||
IFERT("process-thread-queue-depth");
|
||||
IFERT("read-thread-count");
|
||||
IFERT("readdirplus");
|
||||
IFERT("scheduling-priority");
|
||||
|
|
@ -123,6 +124,7 @@ Config::Config()
|
|||
symlinkify_timeout(3600),
|
||||
fuse_read_thread_count(0),
|
||||
fuse_process_thread_count(-1),
|
||||
fuse_process_thread_queue_depth(0),
|
||||
fuse_pin_threads("false"),
|
||||
version(MERGERFS_VERSION),
|
||||
writeback_cache(false),
|
||||
|
|
@ -200,6 +202,7 @@ Config::Config()
|
|||
_map["threads"] = &fuse_read_thread_count;
|
||||
_map["read-thread-count"] = &fuse_read_thread_count;
|
||||
_map["process-thread-count"] = &fuse_process_thread_count;
|
||||
_map["process-thread-queue-depth"] = &fuse_process_thread_queue_depth;
|
||||
_map["version"] = &version;
|
||||
_map["xattr"] = &xattr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,6 +147,7 @@ public:
|
|||
ConfigUINT64 symlinkify_timeout;
|
||||
ConfigINT fuse_read_thread_count;
|
||||
ConfigINT fuse_process_thread_count;
|
||||
ConfigINT fuse_process_thread_queue_depth;
|
||||
ConfigSTR fuse_pin_threads;
|
||||
ConfigSTR version;
|
||||
ConfigBOOL writeback_cache;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,10 @@ using std::vector;
|
|||
|
||||
typedef char IOCTL_BUF[4096];
|
||||
#define IOCTL_APP_TYPE 0xDF
|
||||
#define IOCTL_FILE_INFO _IOWR(IOCTL_APP_TYPE,0,IOCTL_BUF)
|
||||
#define IOCTL_FILE_INFO _IOWR(IOCTL_APP_TYPE,0,IOCTL_BUF)
|
||||
#define IOCTL_GC _IO(IOCTL_APP_TYPE,1)
|
||||
#define IOCTL_GC1 _IO(IOCTL_APP_TYPE,2)
|
||||
#define IOCTL_INVALIDATE_ALL_NODES _IO(IOCTL_APP_TYPE,3)
|
||||
|
||||
// From linux/btrfs.h
|
||||
#define BTRFS_IOCTL_MAGIC 0x94
|
||||
|
|
@ -334,6 +337,15 @@ namespace l
|
|||
{
|
||||
case IOCTL_FILE_INFO:
|
||||
return l::file_info(ffi_,data_);
|
||||
case IOCTL_GC:
|
||||
fuse_gc();
|
||||
return 0;
|
||||
case IOCTL_GC1:
|
||||
fuse_gc1();
|
||||
return 0;
|
||||
case IOCTL_INVALIDATE_ALL_NODES:
|
||||
fuse_invalidate_all_nodes();
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -ENOTTY;
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@
|
|||
|
||||
#include "fuse.h"
|
||||
|
||||
#include <csignal>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
|
|
@ -195,6 +196,30 @@ namespace l
|
|||
}
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
usr1_signal_handler(int signal_)
|
||||
{
|
||||
syslog_info("Received SIGUSR1 - invalidating all nodes");
|
||||
fuse_invalidate_all_nodes();
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
usr2_signal_handler(int signal_)
|
||||
{
|
||||
syslog_info("Received SIGUSR2 - triggering thorough gc");
|
||||
fuse_gc();
|
||||
}
|
||||
|
||||
static
|
||||
void
|
||||
setup_signal_handlers()
|
||||
{
|
||||
std::signal(SIGUSR1,l::usr1_signal_handler);
|
||||
std::signal(SIGUSR2,l::usr2_signal_handler);
|
||||
}
|
||||
|
||||
int
|
||||
main(const int argc_,
|
||||
char **argv_)
|
||||
|
|
@ -223,6 +248,7 @@ namespace l
|
|||
l::wait_for_mount(cfg);
|
||||
|
||||
l::setup_resources(cfg->scheduling_priority);
|
||||
l::setup_signal_handlers();
|
||||
l::get_fuse_operations(ops,cfg->nullrw);
|
||||
|
||||
if(cfg->lazy_umount_mountpoint)
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ set_fuse_threads(Config::Write &cfg_,
|
|||
{
|
||||
set_kv_option("read-thread-count",cfg_->fuse_read_thread_count.to_string(),args_);
|
||||
set_kv_option("process-thread-count",cfg_->fuse_process_thread_count.to_string(),args_);
|
||||
set_kv_option("process-thread-queue-depth",cfg_->fuse_process_thread_queue_depth.to_string(),args_);
|
||||
set_kv_option("pin-threads",cfg_->fuse_pin_threads.to_string(),args_);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue