Skip to content

Commit

Permalink
mxqd_control: Add new users at tail of user list
Browse files Browse the repository at this point in the history
We are going to rely on the stability of the user list as a secondary
preference criteria to the number of jobs running in the cluster.

Put new user at the end of the user list so they start behind other
waiting users and will stay behing them if the main crtieria
(running_global_slot_count) is equal (e.g. zero).
  • Loading branch information
donald committed Mar 20, 2022
1 parent 0951952 commit cf98592
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mxqd_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,11 @@ struct mxq_group_list *_server_add_group(struct mxq_server *server, struct mxq_g

ulist->server = server;

ulist->next = server->users;
server->users = ulist;
/* add new user at tail, so longer waiting users are preferred */
struct mxq_user_list **lastptr = &server->users;
while (*lastptr)
lastptr = &(*lastptr)->next;
*lastptr = ulist;

server->user_cnt++;

Expand Down

0 comments on commit cf98592

Please sign in to comment.