Skip to content

Commit

Permalink
cgroup: cosmetic update to cgroup_taskset_add()
Browse files Browse the repository at this point in the history
cgroup_taskset_add() was using list_add_tail() when for source csets
but list_move_tail() for destination.  As the operations are gated by
list_empty() test, list_move_tail() is equivalent to list_add_tail()
here.  Use list_add_tail() too for destination csets too.

This doesn't cause any functional changes.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Zefan Li <lizefan@huawei.com>
  • Loading branch information
Tejun Heo committed Jan 16, 2017
1 parent 20c56e5 commit d8ebf51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/cgroup/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1980,8 +1980,8 @@ static void cgroup_taskset_add(struct task_struct *task,
if (list_empty(&cset->mg_node))
list_add_tail(&cset->mg_node, &tset->src_csets);
if (list_empty(&cset->mg_dst_cset->mg_node))
list_move_tail(&cset->mg_dst_cset->mg_node,
&tset->dst_csets);
list_add_tail(&cset->mg_dst_cset->mg_node,
&tset->dst_csets);
}

/**
Expand Down

0 comments on commit d8ebf51

Please sign in to comment.