mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-26 01:46:31 -05:00
checkpoint
This commit is contained in:
parent
be82e83cf3
commit
5fc35874ac
3 changed files with 13 additions and 5 deletions
|
|
@ -3751,7 +3751,7 @@ metrics_log_nodes_info(struct fuse *f_,
|
|||
"node memory pool avail objs: %"PRIu64"\n"
|
||||
"node memory pool total allocated memory: %"PRIu64"\n"
|
||||
"msgbuf allocation count: %"PRIu64"\n"
|
||||
"msgbuf total allocated memory: %"PRIu64"\n"
|
||||
"msgbuf available count: %"PRIu64"\n"
|
||||
"\n"
|
||||
,
|
||||
(uint64_t)time_now,
|
||||
|
|
@ -3767,7 +3767,7 @@ metrics_log_nodes_info(struct fuse *f_,
|
|||
(uint64_t)fmp_avail_objs(&f_->node_fmp.fmp),
|
||||
(uint64_t)fmp_total_allocated_memory(&f_->node_fmp.fmp),
|
||||
(uint64_t)msgbuf_alloc_count(),
|
||||
(uint64_t)msgbuf_alloc_count() * msgbuf_get_bufsize()
|
||||
msgbuf_avail_count()
|
||||
);
|
||||
lfmp_unlock(&f_->node_fmp);
|
||||
|
||||
|
|
@ -3829,9 +3829,10 @@ fuse_maintenance_loop(void *fuse_)
|
|||
if(!f->conf.nogc && gc)
|
||||
{
|
||||
gc = lfmp_gc(&f->node_fmp);
|
||||
// msgbuf_gc();
|
||||
}
|
||||
|
||||
msgbuf_gc();
|
||||
|
||||
if(g_LOG_METRICS)
|
||||
metrics_log_nodes_info_to_tmp_dir(f);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
|
||||
static std::uint32_t g_PAGESIZE = 0;
|
||||
static std::uint32_t g_BUFSIZE = 0;
|
||||
//static std::atomic_uint g_TOTAL_ALLOCED;
|
||||
|
||||
static std::mutex g_MUTEX;
|
||||
static std::vector<fuse_msgbuf_t*> g_MSGBUF_STACK;
|
||||
|
|
@ -51,7 +50,7 @@ __attribute__((destructor))
|
|||
void
|
||||
msgbuf_destroy()
|
||||
{
|
||||
// TODO: cleanup?
|
||||
msgbuf_gc();
|
||||
}
|
||||
|
||||
uint32_t
|
||||
|
|
@ -134,6 +133,12 @@ msgbuf_alloc_count()
|
|||
return g_MSGBUF_ALLOCED.size();
|
||||
}
|
||||
|
||||
uint64_t
|
||||
msgbuf_avail_count()
|
||||
{
|
||||
return g_MSGBUF_STACK.size();
|
||||
}
|
||||
|
||||
void
|
||||
msgbuf_gc()
|
||||
{
|
||||
|
|
@ -144,6 +149,7 @@ msgbuf_gc()
|
|||
oldstack.swap(g_MSGBUF_STACK);
|
||||
}
|
||||
|
||||
fprintf(stderr,"freeing %lu msgbufs\n",oldstack.size());
|
||||
for(auto msgbuf: oldstack)
|
||||
{
|
||||
g_MSGBUF_ALLOCED.erase(msgbuf);
|
||||
|
|
|
|||
|
|
@ -32,5 +32,6 @@ void msgbuf_free(fuse_msgbuf_t *msgbuf);
|
|||
void msgbuf_gc();
|
||||
|
||||
uint64_t msgbuf_alloc_count();
|
||||
uint64_t msgbuf_avail_count();
|
||||
|
||||
EXTERN_C_END
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue