53 #ifndef _HAVOQGT_CACHE_UTILI_HPP
54 #define _HAVOQGT_CACHE_UTILI_HPP
59 template<
typename Vector>
61 uintptr_t temp =
reinterpret_cast<uintptr_t
>(&(vec[0]));
63 return reinterpret_cast<char *
>(temp);
67 template<
typename Vector>
69 size_t length = vec.size() *
sizeof(vec[0]);
70 length += (4096 - length%4096);
75 template<
typename Vector>
80 int t = madvise(addr, length, MADV_RANDOM);
85 template<
typename Vector>
90 int t = msync(addr, length, MS_SYNC);
92 int t2 = madvise(addr, length, MADV_DONTNEED);
101 template<
typename Vector>
106 int t = msync(addr, length, MS_SYNC);
110 template<
typename Vector>
115 int t = msync(addr, length, MS_SYNC);
117 int t2 = madvise(addr, length, MADV_DONTNEED);
119 t2 = madvise(addr, length, MADV_RANDOM);
126 #ifndef DIRTY_THRESHOLD_GB
127 #define DIRTY_THRESHOLD_GB 70
142 printf(
"#################################################################\n");
143 printf(
"System Information\n");
144 printf(
"#################################################################\n");
147 printf(
"\n-----------------------------------------------------------------\n");
148 system(
"echo \"SLURM_NODELIST = $SLURM_NODELIST \"");
149 printf(
"-----------------------------------------------------------------\n");
151 printf(
"\n-----------------------------------------------------------------\n");
152 printf(
"Tuned Info:\n");
153 printf(
"-----------------------------------------------------------------\n");
154 system(
"echo \"/proc/sys/vm/dirty_ratio = $(cat /proc/sys/vm/dirty_ratio)\"");
155 system(
"echo \"/proc/sys/vm/dirty_background_ratio = $(cat /proc/sys/vm/dirty_background_ratio)\"");
156 system(
"echo \"/proc/sys/vm/dirty_expire_centisecs = $(cat /proc/sys/vm/dirty_expire_centisecs)\"");
158 printf(
"\n-----------------------------------------------------------------\n");
159 printf(
"df -h /l/ssd\n");
160 printf(
"-----------------------------------------------------------------\n");
161 system(
"df -h /l/ssd");
163 printf(
"\n-----------------------------------------------------------------\n");
164 printf(
"ls /l/ssd\n");
165 printf(
"-----------------------------------------------------------------\n");
169 printf(
"\n-----------------------------------------------------------------\n");
170 printf(
"io-stat -m | grep md0 2>&1\n");
171 printf(
"-----------------------------------------------------------------\n");
172 system(
"iostat -m | grep Device 2>&1");
173 system(
"iostat -m | grep md0 2>&1");
177 printf(
"\n-----------------------------------------------------------------\n");
178 system(
"echo \"/proc/di-mmap-runtimeA-stats = $(cat /proc/di-mmap-runtimeA-stats)\"");
179 printf(
"-----------------------------------------------------------------\n");
189 printf(
"\n-----------------------------------------------------------------\n");
191 printf(
"-----------------------------------------------------------------\n");
212 return (dirty_kb > dirty_threshold_kb);
289 #endif // _HAVOQGT_CACHE_UTILI_HPP
void flush_vector(Vector &vec)
void flush_advise_vector(Vector &vec)
void advise_vector_rand(Vector &vec)
void flush_advise_vector_dont_need(Vector &vec)
void get_io_stat_info(int &r, int &w)
size_t get_length(Vector &vec)
uint32_t get_dirty_pages()
void print_system_info(bool print_dimmap)
#define DIRTY_THRESHOLD_GB
uint32_t get_disk_utilization()
char * get_address(Vector &vec)