diff --git a/NEWS b/NEWS index 1385e9055f0c9dd92b733e8e6855688f1795ea50..fe5f67570334a143b2f9d3523215997692211f7f 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,9 @@ documents those changes that are of interest to users and administrators. array element per line. -- Reset backfill timers correctly without skipping over them in certain circumstances. + -- When running the "scontrol top" command, make sure that all of the user's + jobs have a priority that is lower than the selected job. Previous logic + would permit other jobs with equal priority (no jobs with higher priority). * Changes in Slurm 17.02.2 ========================== diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c index 4e11338d276d0aed49b40053fbc2cc74d531e197..edeb4dce01b1b0eeb57da7a2e5a04b06549b1880 100644 --- a/src/slurmctld/job_mgr.c +++ b/src/slurmctld/job_mgr.c @@ -14833,7 +14833,7 @@ static int _set_top(struct job_record *job_ptr, uid_t uid) list_iterator_destroy(job_iterator); /* Now adjust nice values and priorities of effected jobs */ - if (high_prio > job_ptr->priority) { + if (high_prio >= job_ptr->priority) { delta_nice = high_prio - job_ptr->priority; delta_nice = MIN(job_ptr->details->nice, delta_nice); job_ptr->priority += delta_nice; @@ -14841,13 +14841,16 @@ static int _set_top(struct job_record *job_ptr, uid_t uid) for (i = 0; i < high_prio_job_cnt; i++) { adj_prio = delta_nice / (high_prio_job_cnt - i); job_test_ptr = job_adj_list[i]; + if (job_test_ptr->priority == high_prio) + adj_prio = MAX(adj_prio, 1); /* ensure lower */ adj_prio = MIN((job_test_ptr->priority - 1), adj_prio); max_delta = (uint32_t) 0xffffffff - job_test_ptr->details->nice; adj_prio = MIN(max_delta, adj_prio); job_test_ptr->priority -= adj_prio; job_test_ptr->details->nice += adj_prio; - delta_nice -= adj_prio; + if (delta_nice >= adj_prio) + delta_nice -= adj_prio; } last_job_update = time(NULL); }