|
@ -62,6 +62,7 @@ struct fuse_config |
|
|
unsigned int umask; |
|
|
unsigned int umask; |
|
|
int remember; |
|
|
int remember; |
|
|
int debug; |
|
|
int debug; |
|
|
|
|
|
int nogc; |
|
|
int use_ino; |
|
|
int use_ino; |
|
|
int set_mode; |
|
|
int set_mode; |
|
|
int set_uid; |
|
|
int set_uid; |
|
@ -3903,6 +3904,7 @@ static const struct fuse_opt fuse_lib_opts[] = |
|
|
FUSE_OPT_KEY("-d", FUSE_OPT_KEY_KEEP), |
|
|
FUSE_OPT_KEY("-d", FUSE_OPT_KEY_KEEP), |
|
|
FUSE_LIB_OPT("debug", debug,1), |
|
|
FUSE_LIB_OPT("debug", debug,1), |
|
|
FUSE_LIB_OPT("-d", debug,1), |
|
|
FUSE_LIB_OPT("-d", debug,1), |
|
|
|
|
|
FUSE_LIB_OPT("nogc", nogc,1), |
|
|
FUSE_LIB_OPT("umask=", set_mode,1), |
|
|
FUSE_LIB_OPT("umask=", set_mode,1), |
|
|
FUSE_LIB_OPT("umask=%o", umask,0), |
|
|
FUSE_LIB_OPT("umask=%o", umask,0), |
|
|
FUSE_LIB_OPT("uid=", set_uid,1), |
|
|
FUSE_LIB_OPT("uid=", set_uid,1), |
|
@ -4002,9 +4004,10 @@ void |
|
|
metrics_log_nodes_info(struct fuse *f_, |
|
|
metrics_log_nodes_info(struct fuse *f_, |
|
|
FILE *file_) |
|
|
FILE *file_) |
|
|
{ |
|
|
{ |
|
|
pthread_mutex_lock(&f_->lock); |
|
|
|
|
|
|
|
|
char buf[1024]; |
|
|
|
|
|
|
|
|
fprintf(file_, |
|
|
|
|
|
|
|
|
pthread_mutex_lock(&f_->lock); |
|
|
|
|
|
snprintf(buf,sizeof(buf), |
|
|
"time: %zu\n" |
|
|
"time: %zu\n" |
|
|
"sizeof(node): %zu\n" |
|
|
"sizeof(node): %zu\n" |
|
|
"node id_table size: %zu\n" |
|
|
"node id_table size: %zu\n" |
|
@ -4032,8 +4035,9 @@ metrics_log_nodes_info(struct fuse *f_, |
|
|
lfmp_avail_objs(&f_->node_fmp), |
|
|
lfmp_avail_objs(&f_->node_fmp), |
|
|
lfmp_total_allocated_memory(&f_->node_fmp) |
|
|
lfmp_total_allocated_memory(&f_->node_fmp) |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
pthread_mutex_unlock(&f_->lock); |
|
|
pthread_mutex_unlock(&f_->lock); |
|
|
|
|
|
|
|
|
|
|
|
fputs(buf,file_); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static |
|
|
static |
|
@ -4068,11 +4072,13 @@ static |
|
|
void* |
|
|
void* |
|
|
fuse_maintenance_loop(void *fuse_) |
|
|
fuse_maintenance_loop(void *fuse_) |
|
|
{ |
|
|
{ |
|
|
|
|
|
int gc; |
|
|
int loops; |
|
|
int loops; |
|
|
int sleep_time; |
|
|
int sleep_time; |
|
|
double slab_usage_ratio; |
|
|
double slab_usage_ratio; |
|
|
struct fuse *f = (struct fuse*)fuse_; |
|
|
struct fuse *f = (struct fuse*)fuse_; |
|
|
|
|
|
|
|
|
|
|
|
gc = 0; |
|
|
loops = 0; |
|
|
loops = 0; |
|
|
sleep_time = 60; |
|
|
sleep_time = 60; |
|
|
while(1) |
|
|
while(1) |
|
@ -4080,12 +4086,15 @@ fuse_maintenance_loop(void *fuse_) |
|
|
if(remember_nodes(f)) |
|
|
if(remember_nodes(f)) |
|
|
fuse_prune_remembered_nodes(f); |
|
|
fuse_prune_remembered_nodes(f); |
|
|
|
|
|
|
|
|
slab_usage_ratio = lfmp_slab_usage_ratio(&f->node_fmp); |
|
|
|
|
|
if(slab_usage_ratio > 3.0) |
|
|
|
|
|
lfmp_gc(&f->node_fmp); |
|
|
|
|
|
|
|
|
|
|
|
if(loops % 15) |
|
|
|
|
|
|
|
|
if((loops % 15) == 0) |
|
|
|
|
|
{ |
|
|
fuse_malloc_trim(); |
|
|
fuse_malloc_trim(); |
|
|
|
|
|
gc = 1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Trigger a followup gc if this gc succeeds |
|
|
|
|
|
if(!f->conf.nogc && gc) |
|
|
|
|
|
gc = lfmp_gc(&f->node_fmp); |
|
|
|
|
|
|
|
|
if(g_LOG_METRICS) |
|
|
if(g_LOG_METRICS) |
|
|
metrics_log_nodes_info_to_tmp_dir(f); |
|
|
metrics_log_nodes_info_to_tmp_dir(f); |
|
|