fprintf(stderr, "\n");
fprintf(stderr, "Options :\n");
fprintf(stderr, "-d, --debug Run lxcfs with debugging enabled\n");
+ fprintf(stderr, "--disable-cfs Disable cpu virtualization via cpu shares\n");
fprintf(stderr, "-f, --foreground Run lxcfs in the foreground\n");
fprintf(stderr, "-n, --help Print help\n");
fprintf(stderr, "-l, --enable-loadavg Enable loadavg virtualization\n");
}
opts->swap_off = false;
opts->use_pidfd = false;
+ opts->use_cfs = true;
/* accomodate older init scripts */
swallow_arg(&argc, argv, "-s");
/* --enable-pidfd */
opts->use_pidfd = swallow_arg(&argc, argv, "--enable-pidfd");
+ /* --disable-cfs */
+ if (swallow_arg(&argc, argv, "--disable-cfs"))
+ opts->use_cfs = false;
+
if (swallow_option(&argc, argv, "-o", &v)) {
/* Parse multiple values */
for (; (token = strtok_r(v, ",", &saveptr)); v = NULL) {
__do_free void *fopen_cache = NULL;
__do_fclose FILE *f = NULL;
struct fuse_context *fc = fuse_get_context();
+ struct lxcfs_opts *opts = (struct lxcfs_opts *)fc->private_data;
struct file_info *d = INTTYPE_TO_PTR(fi->fh);
size_t linelen = 0, total_len = 0;
bool am_printing = false, firstline = true, is_s390x = false;
if (!cpuset)
return 0;
- use_view = cgroup_ops->can_use_cpuview(cgroup_ops);
+ if (cgroup_ops->can_use_cpuview(cgroup_ops) && opts->use_cfs)
+ use_view = true;
+
if (use_view)
max_cpus = max_cpu_count(cg);