mirror of
https://github.com/schoebel/mars
synced 2025-04-01 22:58:34 +00:00
mem: show raw statistics in /proc
This commit is contained in:
parent
ea9068e992
commit
5041dd1cf4
@ -51,6 +51,8 @@ long long brick_global_memavail = 0;
|
||||
EXPORT_SYMBOL_GPL(brick_global_memavail);
|
||||
long long brick_global_memlimit = 0;
|
||||
EXPORT_SYMBOL_GPL(brick_global_memlimit);
|
||||
atomic64_t brick_global_block_used = ATOMIC64_INIT(0);
|
||||
EXPORT_SYMBOL_GPL(brick_global_block_used);
|
||||
|
||||
void get_total_ram(void)
|
||||
{
|
||||
@ -328,6 +330,9 @@ void *__brick_block_alloc(gfp_t gfp, int order)
|
||||
msleep(1000);
|
||||
}
|
||||
#endif
|
||||
|
||||
atomic64_add((PAGE_SIZE/1024) << order, &brick_global_block_used);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -342,6 +347,7 @@ void __brick_block_free(void *data, int order)
|
||||
#ifdef BRICK_DEBUG_MEM
|
||||
atomic_dec(&raw_count[order]);
|
||||
#endif
|
||||
atomic64_sub((PAGE_SIZE/1024) << order, &brick_global_block_used);
|
||||
}
|
||||
|
||||
bool brick_allow_freelist = true;
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
extern long long brick_global_memavail;
|
||||
extern long long brick_global_memlimit;
|
||||
extern atomic64_t brick_global_block_used;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -148,7 +148,8 @@ ctl_table mars_table[] = {
|
||||
INT_ENTRY("syslog_min_class", brick_say_syslog_min, 0600),
|
||||
INT_ENTRY("syslog_max_class", brick_say_syslog_max, 0600),
|
||||
INT_ENTRY("percent_mem_limit_kb", mars_mem_percent, 0600),
|
||||
INT_ENTRY("mem_used_kb", trans_logger_mem_usage, 0400),
|
||||
INT_ENTRY("logger_mem_used_kb", trans_logger_mem_usage, 0400),
|
||||
INT_ENTRY("raw_mem_used_kb", brick_global_block_used,0400),
|
||||
INT_ENTRY("logrot_auto_gb", global_logrot_auto, 0600),
|
||||
INT_ENTRY("logdel_auto_gb", global_logdel_auto, 0600),
|
||||
INT_ENTRY("free_space_mb", global_free_space, 0600),
|
||||
|
Loading…
Reference in New Issue
Block a user