diff --git a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.c b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.c index 83510ca1e344fa14603626fcdf1a278e22d41738..e5acda2d37319d37d5e66994db71dc9a3f45519f 100644 --- a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.c +++ b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.c @@ -105,12 +105,9 @@ static slurm_cgroup_conf_t slurm_cgroup_conf; static void _prec_extra(jag_prec_t *prec, int pagesize) { int utime, stime, total_rss, total_pgpgin; - int dev_major; - uint64_t read_bytes, write_bytes, tot_read, tot_write; char *cpu_time, *memory_stat, *ptr; - char *blkio_bytes, *next_device; size_t cpu_time_size, memory_stat_size; - size_t blkio_bytes_size; + //DEF_TIMERS; //START_TIMER; @@ -139,28 +136,34 @@ static void _prec_extra(jag_prec_t *prec, int pagesize) prec->pages = total_pgpgin; } - /* "Read" and "Write" from blkio.throttle.io_service_bytes are + /* FIXME: Enable when kernel support ready. + * + * "Read" and "Write" from blkio.throttle.io_service_bytes are * counts of bytes read and written for physical disk I/Os only. * These counts do not include disk I/Os satisfied from cache. */ - xcgroup_get_param(&task_blkio_cg, "blkio.throttle.io_service_bytes", - &blkio_bytes, &blkio_bytes_size); - next_device = blkio_bytes; - tot_read = tot_write = 0; - while ((sscanf(next_device, "%d:", &dev_major)) > 0) { - if ((dev_major > 239) && (dev_major < 255)) - /* skip experimental device codes */ - continue; - next_device = strstr(next_device, "Read"); - sscanf(next_device, "%*s %"PRIu64"", &read_bytes); - next_device = strstr(next_device, "Write"); - sscanf(next_device, "%*s %"PRIu64"", &write_bytes); - tot_read+=read_bytes; - tot_write+=write_bytes; - next_device = strstr(next_device, "Total"); - } - prec->disk_read = (double)tot_read / (double)1048576; - prec->disk_write = (double)tot_write / (double)1048576; + /* int dev_major; */ + /* uint64_t read_bytes, write_bytes, tot_read, tot_write; */ + /* char *blkio_bytes, *next_device; */ + /* size_t blkio_bytes_size; */ + /* xcgroup_get_param(&task_blkio_cg, "blkio.throttle.io_service_bytes", */ + /* &blkio_bytes, &blkio_bytes_size); */ + /* next_device = blkio_bytes; */ + /* tot_read = tot_write = 0; */ + /* while ((sscanf(next_device, "%d:", &dev_major)) > 0) { */ + /* if ((dev_major > 239) && (dev_major < 255)) */ + /* /\* skip experimental device codes *\/ */ + /* continue; */ + /* next_device = strstr(next_device, "Read"); */ + /* sscanf(next_device, "%*s %"PRIu64"", &read_bytes); */ + /* next_device = strstr(next_device, "Write"); */ + /* sscanf(next_device, "%*s %"PRIu64"", &write_bytes); */ + /* tot_read+=read_bytes; */ + /* tot_write+=write_bytes; */ + /* next_device = strstr(next_device, "Total"); */ + /* } */ + /* prec->disk_read = (double)tot_read / (double)1048576; */ + /* prec->disk_write = (double)tot_write / (double)1048576; */ /* info("after %d %d", total_rss, pagesize); */ /* print_jag_prec(prec); */ @@ -221,14 +224,16 @@ extern int init (void) return SLURM_ERROR; } - /* Enable blkio subsystem. + /* FIXME: Enable when kernel support ready. + * + * Enable blkio subsystem. */ - if (jobacct_gather_cgroup_blkio_init(&slurm_cgroup_conf) - != SLURM_SUCCESS) { - xcpuinfo_fini(); - free_slurm_cgroup_conf(&slurm_cgroup_conf); - return SLURM_ERROR; - } + /* if (jobacct_gather_cgroup_blkio_init(&slurm_cgroup_conf) */ + /* != SLURM_SUCCESS) { */ + /* xcpuinfo_fini(); */ + /* free_slurm_cgroup_conf(&slurm_cgroup_conf); */ + /* return SLURM_ERROR; */ + /* } */ } verbose("%s loaded", plugin_name); @@ -240,7 +245,7 @@ extern int fini (void) if (_run_in_daemon()) { jobacct_gather_cgroup_cpuacct_fini(&slurm_cgroup_conf); jobacct_gather_cgroup_memory_fini(&slurm_cgroup_conf); - jobacct_gather_cgroup_blkio_fini(&slurm_cgroup_conf); + /* jobacct_gather_cgroup_blkio_fini(&slurm_cgroup_conf); */ acct_gather_energy_fini(); /* unload configuration */ @@ -300,9 +305,9 @@ extern int jobacct_gather_p_add_task(pid_t pid, jobacct_id_t *jobacct_id) SLURM_SUCCESS) return SLURM_ERROR; - if (jobacct_gather_cgroup_blkio_attach_task(pid, jobacct_id) != - SLURM_SUCCESS) - return SLURM_ERROR; + /* if (jobacct_gather_cgroup_blkio_attach_task(pid, jobacct_id) != */ + /* SLURM_SUCCESS) */ + /* return SLURM_ERROR; */ return SLURM_SUCCESS; } diff --git a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.h b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.h index ab795b9fd03bea50d1eea25824fdfd1d7b44bfa4..9f64673ef6fa63166430a7e03338ebdd83b6f515 100644 --- a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.h +++ b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.h @@ -46,7 +46,6 @@ extern xcgroup_t task_memory_cg; extern xcgroup_t task_cpuacct_cg; -extern xcgroup_t task_blkio_cg; extern int jobacct_gather_cgroup_cpuacct_init( slurm_cgroup_conf_t *slurm_cgroup_conf); @@ -66,13 +65,15 @@ extern int jobacct_gather_cgroup_memory_fini( extern int jobacct_gather_cgroup_memory_attach_task( pid_t pid, jobacct_id_t *jobacct_id); -extern int jobacct_gather_cgroup_blkio_init( - slurm_cgroup_conf_t *slurm_cgroup_conf); +/* FIXME: Enable when kernel support ready. */ + /* extern xcgroup_t task_blkio_cg; */ +/* extern int jobacct_gather_cgroup_blkio_init( */ +/* slurm_cgroup_conf_t *slurm_cgroup_conf); */ -extern int jobacct_gather_cgroup_blkio_fini( - slurm_cgroup_conf_t *slurm_cgroup_conf); +/* extern int jobacct_gather_cgroup_blkio_fini( */ +/* slurm_cgroup_conf_t *slurm_cgroup_conf); */ -extern int jobacct_gather_cgroup_blkio_attach_task( - pid_t pid, jobacct_id_t *jobacct_id); +/* extern int jobacct_gather_cgroup_blkio_attach_task( */ +/* pid_t pid, jobacct_id_t *jobacct_id); */ extern char* jobacct_cgroup_create_slurm_cg (xcgroup_ns_t* ns); diff --git a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_blkio.c b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_blkio.c index 977349d61a3862fb9b8721932476cb62614b1c5b..2df5a467b10cd52d484a3078240bbc752762ea5e 100644 --- a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_blkio.c +++ b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_blkio.c @@ -36,276 +36,278 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. \*****************************************************************************/ -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include <sys/types.h> -#include <stdlib.h> /* getenv */ - -#include "slurm/slurm_errno.h" -#include "slurm/slurm.h" -#include "src/common/xstring.h" -#include "src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.h" -#include "src/slurmd/slurmstepd/slurmstepd_job.h" -#include "src/slurmd/slurmd/slurmd.h" - -#ifndef PATH_MAX -#define PATH_MAX 256 -#endif - -static char user_cgroup_path[PATH_MAX]; -static char job_cgroup_path[PATH_MAX]; -static char jobstep_cgroup_path[PATH_MAX]; -static char task_cgroup_path[PATH_MAX]; - -static xcgroup_ns_t blkio_ns; - -static xcgroup_t user_blkio_cg; -static xcgroup_t job_blkio_cg; -static xcgroup_t step_blkio_cg; -xcgroup_t task_blkio_cg; - - -extern int jobacct_gather_cgroup_blkio_init( - slurm_cgroup_conf_t *slurm_cgroup_conf) -{ - /* initialize user/job/jobstep cgroup relative paths */ - user_cgroup_path[0]='\0'; - job_cgroup_path[0]='\0'; - jobstep_cgroup_path[0]='\0'; - - /* initialize blkio cgroup namespace */ - if (xcgroup_ns_create(slurm_cgroup_conf, &blkio_ns, "", "blkio") - != XCGROUP_SUCCESS) { - error("jobacct_gather/cgroup: unable to create blkio " - "namespace"); - return SLURM_ERROR; - } - return SLURM_SUCCESS; -} - -extern int jobacct_gather_cgroup_blkio_fini( - slurm_cgroup_conf_t *slurm_cgroup_conf) -{ - if (user_cgroup_path[0] == '\0' || - job_cgroup_path[0] == '\0' || - jobstep_cgroup_path[0] == '\0') - return SLURM_SUCCESS; - - xcgroup_destroy(&user_blkio_cg); - xcgroup_destroy(&job_blkio_cg); - xcgroup_destroy(&step_blkio_cg); - - user_cgroup_path[0]='\0'; - job_cgroup_path[0]='\0'; - jobstep_cgroup_path[0]='\0'; - - xcgroup_ns_destroy(&blkio_ns); - - return SLURM_SUCCESS; -} - -extern int jobacct_gather_cgroup_blkio_attach_task( - pid_t pid, jobacct_id_t *jobacct_id) -{ - xcgroup_t blkio_cg; - stepd_step_rec_t *job; - uid_t uid; - gid_t gid; - uint32_t jobid; - uint32_t stepid; - uint32_t taskid; - int fstatus = SLURM_SUCCESS; - int rc; - char* slurm_cgpath; - - job = jobacct_id->job; - uid = job->uid; - gid = job->gid; - jobid = job->jobid; - stepid = job->stepid; - taskid = jobacct_id->taskid; - - /* create slurm root cg in this cg namespace */ - slurm_cgpath = jobacct_cgroup_create_slurm_cg(&blkio_ns); - if (!slurm_cgpath) { - return SLURM_ERROR; - } - - /* build user cgroup relative path if not set (should not be) */ - if (*user_cgroup_path == '\0') { - if (snprintf(user_cgroup_path, PATH_MAX, - "%s/uid_%u", slurm_cgpath, uid) >= PATH_MAX) { - error("unable to build uid %u cgroup relative " - "path : %m", uid); - xfree(slurm_cgpath); - return SLURM_ERROR; - } - } - - /* build job cgroup relative path if not set (may not be) */ - if (*job_cgroup_path == '\0') { - if (snprintf(job_cgroup_path, PATH_MAX, "%s/job_%u", - user_cgroup_path, jobid) >= PATH_MAX) { - error("jobacct_gather/cgroup: unable to build job %u " - "blkio cg relative path : %m", jobid); - return SLURM_ERROR; - } - } - - /* build job step cgroup relative path if not set (may not be) */ - if (*jobstep_cgroup_path == '\0') { - if (snprintf(jobstep_cgroup_path, PATH_MAX, "%s/step_%u", - job_cgroup_path, stepid) >= PATH_MAX) { - error("jobacct_gather/cgroup: unable to build job step " - "%u blkio cg relative path : %m", stepid); - return SLURM_ERROR; - } - } - - /* build task cgroup relative path */ - if (snprintf(task_cgroup_path, PATH_MAX, "%s/task_%u", - jobstep_cgroup_path, taskid) >= PATH_MAX) { - error("jobacct_gather/cgroup: unable to build task %u " - "blkio cg relative path : %m", taskid); - return SLURM_ERROR; - } - - fstatus = SLURM_SUCCESS; - - /* - * create blkio root cg and lock it - * - * we will keep the lock until the end to avoid the effect of a release - * agent that would remove an existing cgroup hierarchy while we are - * setting it up. As soon as the step cgroup is created, we can release - * the lock. - * Indeed, consecutive slurm steps could result in cg being removed - * between the next EEXIST instanciation and the first addition of - * a task. The release_agent will have to lock the root blkio cgroup - * to avoid this scenario. - */ - - if (xcgroup_create(&blkio_ns, &blkio_cg, "", 0, 0) - != XCGROUP_SUCCESS) { - error("jobacct_gather/cgroup: unable to create root blkio " - "xcgroup"); - return SLURM_ERROR; - } - if (xcgroup_lock(&blkio_cg) != XCGROUP_SUCCESS) { - xcgroup_destroy(&blkio_cg); - error("jobacct_gather/cgroup: unable to lock root blkio cg"); - return SLURM_ERROR; - } - - /* - * Create user cgroup in the blkio ns (it could already exist) - */ - if (xcgroup_create(&blkio_ns, &user_blkio_cg, - user_cgroup_path, - uid, gid) != XCGROUP_SUCCESS) { - error("jobacct_gather/cgroup: unable to create user %u blkio " - "cgroup", uid); - fstatus = SLURM_ERROR; - goto error; - } - - if (xcgroup_instanciate(&user_blkio_cg) != XCGROUP_SUCCESS) { - xcgroup_destroy(&user_blkio_cg); - error("jobacct_gather/cgroup: unable to instanciate user %u " - "blkio cgroup", uid); - fstatus = SLURM_ERROR; - goto error; - } - - /* - * Create job cgroup in the blkio ns (it could already exist) - */ - if (xcgroup_create(&blkio_ns, &job_blkio_cg, - job_cgroup_path, - uid, gid) != XCGROUP_SUCCESS) { - xcgroup_destroy(&user_blkio_cg); - error("jobacct_gather/cgroup: unable to create job %u blkio " - "cgroup", jobid); - fstatus = SLURM_ERROR; - goto error; - } - - if (xcgroup_instanciate(&job_blkio_cg) != XCGROUP_SUCCESS) { - xcgroup_destroy(&user_blkio_cg); - xcgroup_destroy(&job_blkio_cg); - error("jobacct_gather/cgroup: unable to instanciate job %u " - "blkio cgroup", jobid); - fstatus = SLURM_ERROR; - goto error; - } - - /* - * Create step cgroup in the blkio ns (it could already exist) - */ - if (xcgroup_create(&blkio_ns, &step_blkio_cg, - jobstep_cgroup_path, - uid, gid) != XCGROUP_SUCCESS) { - /* do not delete user/job cgroup as they can exist for other - * steps, but release cgroup structures */ - xcgroup_destroy(&user_blkio_cg); - xcgroup_destroy(&job_blkio_cg); - error("jobacct_gather/cgroup: unable to create jobstep %u.%u " - "blkio cgroup", jobid, stepid); - fstatus = SLURM_ERROR; - goto error; - } - - if (xcgroup_instanciate(&step_blkio_cg) != XCGROUP_SUCCESS) { - xcgroup_destroy(&user_blkio_cg); - xcgroup_destroy(&job_blkio_cg); - xcgroup_destroy(&step_blkio_cg); - error("jobacct_gather/cgroup: unable to instantiate jobstep " - "%u.%u blkio cgroup", jobid, stepid); - fstatus = SLURM_ERROR; - goto error; - } - - /* - * Create task cgroup in the blkio ns - */ - if (xcgroup_create(&blkio_ns, &task_blkio_cg, - task_cgroup_path, - uid, gid) != XCGROUP_SUCCESS) { - /* do not delete user/job cgroup as they can exist for other - * steps, but release cgroup structures */ - xcgroup_destroy(&user_blkio_cg); - xcgroup_destroy(&job_blkio_cg); - error("jobacct_gather/cgroup: unable to create jobstep %u.%u " - "task %u blkio cgroup", jobid, stepid, taskid); - fstatus = SLURM_ERROR; - goto error; - } - - if (xcgroup_instanciate(&task_blkio_cg) != XCGROUP_SUCCESS) { - xcgroup_destroy(&user_blkio_cg); - xcgroup_destroy(&job_blkio_cg); - xcgroup_destroy(&step_blkio_cg); - error("jobacct_gather/cgroup: unable to instantiate jobstep " - "%u.%u task %u blkio cgroup", jobid, stepid, taskid); - fstatus = SLURM_ERROR; - goto error; - } - - /* - * Attach the slurmstepd to the task blkio cgroup - */ - rc = xcgroup_add_pids(&task_blkio_cg, &pid, 1); - if (rc != XCGROUP_SUCCESS) { - error("jobacct_gather/cgroup: unable to add slurmstepd to " - "blkio cg '%s'", task_blkio_cg.path); - fstatus = SLURM_ERROR; - } else - fstatus = SLURM_SUCCESS; - -error: - xcgroup_unlock(&blkio_cg); - xcgroup_destroy(&blkio_cg); - return fstatus; -} +/* FIXME: Enable when kernel support is ready. */ + +/* #if HAVE_CONFIG_H */ +/* #include "config.h" */ +/* #endif */ + +/* #include <sys/types.h> */ +/* #include <stdlib.h> /\* getenv *\/ */ + +/* #include "slurm/slurm_errno.h" */ +/* #include "slurm/slurm.h" */ +/* #include "src/common/xstring.h" */ +/* #include "src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.h" */ +/* #include "src/slurmd/slurmstepd/slurmstepd_job.h" */ +/* #include "src/slurmd/slurmd/slurmd.h" */ + +/* #ifndef PATH_MAX */ +/* #define PATH_MAX 256 */ +/* #endif */ + +/* static char user_cgroup_path[PATH_MAX]; */ +/* static char job_cgroup_path[PATH_MAX]; */ +/* static char jobstep_cgroup_path[PATH_MAX]; */ +/* static char task_cgroup_path[PATH_MAX]; */ + +/* static xcgroup_ns_t blkio_ns; */ + +/* static xcgroup_t user_blkio_cg; */ +/* static xcgroup_t job_blkio_cg; */ +/* static xcgroup_t step_blkio_cg; */ +/* xcgroup_t task_blkio_cg; */ + + +/* extern int jobacct_gather_cgroup_blkio_init( */ +/* slurm_cgroup_conf_t *slurm_cgroup_conf) */ +/* { */ +/* /\* initialize user/job/jobstep cgroup relative paths *\/ */ +/* user_cgroup_path[0]='\0'; */ +/* job_cgroup_path[0]='\0'; */ +/* jobstep_cgroup_path[0]='\0'; */ + +/* /\* initialize blkio cgroup namespace *\/ */ +/* if (xcgroup_ns_create(slurm_cgroup_conf, &blkio_ns, "", "blkio") */ +/* != XCGROUP_SUCCESS) { */ +/* error("jobacct_gather/cgroup: unable to create blkio " */ +/* "namespace"); */ +/* return SLURM_ERROR; */ +/* } */ +/* return SLURM_SUCCESS; */ +/* } */ + +/* extern int jobacct_gather_cgroup_blkio_fini( */ +/* slurm_cgroup_conf_t *slurm_cgroup_conf) */ +/* { */ +/* if (user_cgroup_path[0] == '\0' || */ +/* job_cgroup_path[0] == '\0' || */ +/* jobstep_cgroup_path[0] == '\0') */ +/* return SLURM_SUCCESS; */ + +/* xcgroup_destroy(&user_blkio_cg); */ +/* xcgroup_destroy(&job_blkio_cg); */ +/* xcgroup_destroy(&step_blkio_cg); */ + +/* user_cgroup_path[0]='\0'; */ +/* job_cgroup_path[0]='\0'; */ +/* jobstep_cgroup_path[0]='\0'; */ + +/* xcgroup_ns_destroy(&blkio_ns); */ + +/* return SLURM_SUCCESS; */ +/* } */ + +/* extern int jobacct_gather_cgroup_blkio_attach_task( */ +/* pid_t pid, jobacct_id_t *jobacct_id) */ +/* { */ +/* xcgroup_t blkio_cg; */ +/* stepd_step_rec_t *job; */ +/* uid_t uid; */ +/* gid_t gid; */ +/* uint32_t jobid; */ +/* uint32_t stepid; */ +/* uint32_t taskid; */ +/* int fstatus = SLURM_SUCCESS; */ +/* int rc; */ +/* char* slurm_cgpath; */ + +/* job = jobacct_id->job; */ +/* uid = job->uid; */ +/* gid = job->gid; */ +/* jobid = job->jobid; */ +/* stepid = job->stepid; */ +/* taskid = jobacct_id->taskid; */ + +/* /\* create slurm root cg in this cg namespace *\/ */ +/* slurm_cgpath = jobacct_cgroup_create_slurm_cg(&blkio_ns); */ +/* if (!slurm_cgpath) { */ +/* return SLURM_ERROR; */ +/* } */ + +/* /\* build user cgroup relative path if not set (should not be) *\/ */ +/* if (*user_cgroup_path == '\0') { */ +/* if (snprintf(user_cgroup_path, PATH_MAX, */ +/* "%s/uid_%u", slurm_cgpath, uid) >= PATH_MAX) { */ +/* error("unable to build uid %u cgroup relative " */ +/* "path : %m", uid); */ +/* xfree(slurm_cgpath); */ +/* return SLURM_ERROR; */ +/* } */ +/* } */ + +/* /\* build job cgroup relative path if not set (may not be) *\/ */ +/* if (*job_cgroup_path == '\0') { */ +/* if (snprintf(job_cgroup_path, PATH_MAX, "%s/job_%u", */ +/* user_cgroup_path, jobid) >= PATH_MAX) { */ +/* error("jobacct_gather/cgroup: unable to build job %u " */ +/* "blkio cg relative path : %m", jobid); */ +/* return SLURM_ERROR; */ +/* } */ +/* } */ + +/* /\* build job step cgroup relative path if not set (may not be) *\/ */ +/* if (*jobstep_cgroup_path == '\0') { */ +/* if (snprintf(jobstep_cgroup_path, PATH_MAX, "%s/step_%u", */ +/* job_cgroup_path, stepid) >= PATH_MAX) { */ +/* error("jobacct_gather/cgroup: unable to build job step " */ +/* "%u blkio cg relative path : %m", stepid); */ +/* return SLURM_ERROR; */ +/* } */ +/* } */ + +/* /\* build task cgroup relative path *\/ */ +/* if (snprintf(task_cgroup_path, PATH_MAX, "%s/task_%u", */ +/* jobstep_cgroup_path, taskid) >= PATH_MAX) { */ +/* error("jobacct_gather/cgroup: unable to build task %u " */ +/* "blkio cg relative path : %m", taskid); */ +/* return SLURM_ERROR; */ +/* } */ + +/* fstatus = SLURM_SUCCESS; */ + +/* /\* */ +/* * create blkio root cg and lock it */ +/* * */ +/* * we will keep the lock until the end to avoid the effect of a release */ +/* * agent that would remove an existing cgroup hierarchy while we are */ +/* * setting it up. As soon as the step cgroup is created, we can release */ +/* * the lock. */ +/* * Indeed, consecutive slurm steps could result in cg being removed */ +/* * between the next EEXIST instanciation and the first addition of */ +/* * a task. The release_agent will have to lock the root blkio cgroup */ +/* * to avoid this scenario. */ +/* *\/ */ + +/* if (xcgroup_create(&blkio_ns, &blkio_cg, "", 0, 0) */ +/* != XCGROUP_SUCCESS) { */ +/* error("jobacct_gather/cgroup: unable to create root blkio " */ +/* "xcgroup"); */ +/* return SLURM_ERROR; */ +/* } */ +/* if (xcgroup_lock(&blkio_cg) != XCGROUP_SUCCESS) { */ +/* xcgroup_destroy(&blkio_cg); */ +/* error("jobacct_gather/cgroup: unable to lock root blkio cg"); */ +/* return SLURM_ERROR; */ +/* } */ + +/* /\* */ +/* * Create user cgroup in the blkio ns (it could already exist) */ +/* *\/ */ +/* if (xcgroup_create(&blkio_ns, &user_blkio_cg, */ +/* user_cgroup_path, */ +/* uid, gid) != XCGROUP_SUCCESS) { */ +/* error("jobacct_gather/cgroup: unable to create user %u blkio " */ +/* "cgroup", uid); */ +/* fstatus = SLURM_ERROR; */ +/* goto error; */ +/* } */ + +/* if (xcgroup_instanciate(&user_blkio_cg) != XCGROUP_SUCCESS) { */ +/* xcgroup_destroy(&user_blkio_cg); */ +/* error("jobacct_gather/cgroup: unable to instanciate user %u " */ +/* "blkio cgroup", uid); */ +/* fstatus = SLURM_ERROR; */ +/* goto error; */ +/* } */ + +/* /\* */ +/* * Create job cgroup in the blkio ns (it could already exist) */ +/* *\/ */ +/* if (xcgroup_create(&blkio_ns, &job_blkio_cg, */ +/* job_cgroup_path, */ +/* uid, gid) != XCGROUP_SUCCESS) { */ +/* xcgroup_destroy(&user_blkio_cg); */ +/* error("jobacct_gather/cgroup: unable to create job %u blkio " */ +/* "cgroup", jobid); */ +/* fstatus = SLURM_ERROR; */ +/* goto error; */ +/* } */ + +/* if (xcgroup_instanciate(&job_blkio_cg) != XCGROUP_SUCCESS) { */ +/* xcgroup_destroy(&user_blkio_cg); */ +/* xcgroup_destroy(&job_blkio_cg); */ +/* error("jobacct_gather/cgroup: unable to instanciate job %u " */ +/* "blkio cgroup", jobid); */ +/* fstatus = SLURM_ERROR; */ +/* goto error; */ +/* } */ + +/* /\* */ +/* * Create step cgroup in the blkio ns (it could already exist) */ +/* *\/ */ +/* if (xcgroup_create(&blkio_ns, &step_blkio_cg, */ +/* jobstep_cgroup_path, */ +/* uid, gid) != XCGROUP_SUCCESS) { */ +/* /\* do not delete user/job cgroup as they can exist for other */ +/* * steps, but release cgroup structures *\/ */ +/* xcgroup_destroy(&user_blkio_cg); */ +/* xcgroup_destroy(&job_blkio_cg); */ +/* error("jobacct_gather/cgroup: unable to create jobstep %u.%u " */ +/* "blkio cgroup", jobid, stepid); */ +/* fstatus = SLURM_ERROR; */ +/* goto error; */ +/* } */ + +/* if (xcgroup_instanciate(&step_blkio_cg) != XCGROUP_SUCCESS) { */ +/* xcgroup_destroy(&user_blkio_cg); */ +/* xcgroup_destroy(&job_blkio_cg); */ +/* xcgroup_destroy(&step_blkio_cg); */ +/* error("jobacct_gather/cgroup: unable to instantiate jobstep " */ +/* "%u.%u blkio cgroup", jobid, stepid); */ +/* fstatus = SLURM_ERROR; */ +/* goto error; */ +/* } */ + +/* /\* */ +/* * Create task cgroup in the blkio ns */ +/* *\/ */ +/* if (xcgroup_create(&blkio_ns, &task_blkio_cg, */ +/* task_cgroup_path, */ +/* uid, gid) != XCGROUP_SUCCESS) { */ +/* /\* do not delete user/job cgroup as they can exist for other */ +/* * steps, but release cgroup structures *\/ */ +/* xcgroup_destroy(&user_blkio_cg); */ +/* xcgroup_destroy(&job_blkio_cg); */ +/* error("jobacct_gather/cgroup: unable to create jobstep %u.%u " */ +/* "task %u blkio cgroup", jobid, stepid, taskid); */ +/* fstatus = SLURM_ERROR; */ +/* goto error; */ +/* } */ + +/* if (xcgroup_instanciate(&task_blkio_cg) != XCGROUP_SUCCESS) { */ +/* xcgroup_destroy(&user_blkio_cg); */ +/* xcgroup_destroy(&job_blkio_cg); */ +/* xcgroup_destroy(&step_blkio_cg); */ +/* error("jobacct_gather/cgroup: unable to instantiate jobstep " */ +/* "%u.%u task %u blkio cgroup", jobid, stepid, taskid); */ +/* fstatus = SLURM_ERROR; */ +/* goto error; */ +/* } */ + +/* /\* */ +/* * Attach the slurmstepd to the task blkio cgroup */ +/* *\/ */ +/* rc = xcgroup_add_pids(&task_blkio_cg, &pid, 1); */ +/* if (rc != XCGROUP_SUCCESS) { */ +/* error("jobacct_gather/cgroup: unable to add slurmstepd to " */ +/* "blkio cg '%s'", task_blkio_cg.path); */ +/* fstatus = SLURM_ERROR; */ +/* } else */ +/* fstatus = SLURM_SUCCESS; */ + +/* error: */ +/* xcgroup_unlock(&blkio_cg); */ +/* xcgroup_destroy(&blkio_cg); */ +/* return fstatus; */ +/* } */