On Mon, Jun 06, 2016 at 08:20:39AM +0800, Yuyang Du wrote:
> +static void task_move_group_fair(struct task_struct *p, bool fork)
> {
> - detach_task_cfs_rq(p);
> + /*
> + * Newly forked task should not be removed from any cfs_rq
That's a pointless comment; that's exactly what the code _does_.
Comments should explain the code, not restate it.
So a comment like:
* Newly forked tasks are not attached yet.
Is entirely more useful.
> + */
> + if (!fork)
> + detach_task_cfs_rq(p);
> set_task_rq(p, task_cpu(p));
> attach_task_cfs_rq(p);
> /*