| 224 | } |
| 225 | |
| 226 | void |
| 227 | cg_enter(void) |
| 228 | { |
| 229 | if (!cg_enable) |
| 230 | return; |
| 231 | |
| 232 | msg("Entering control group %s\n", cg_name); |
| 233 | |
| 234 | cg_write("cgroup.procs", "%d\n", (int) getpid()); |
| 235 | |
| 236 | if (cg_memory_limit) |
| 237 | { |
| 238 | cg_write("memory.max", "%lld\n", (long long) cg_memory_limit << 10); |
| 239 | cg_write("?memory.swap.max", "0\n"); |
| 240 | } |
| 241 | |
| 242 | struct cf_per_box *cf = cf_current_box(); |
| 243 | if (cf->cpus) |
| 244 | cg_write("cpuset.cpus", "%s", cf->cpus); |
| 245 | if (cf->mems) |
| 246 | cg_write("cpuset.mems", "%s", cf->mems); |
| 247 | } |
| 248 | |
| 249 | static int |
| 250 | raw_get_run_time_ms(void) |
no test coverage detected
searching dependent graphs…