[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 6 Jun 2016 11:58:40 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Yuyang Du <yuyang.du@...el.com>
Cc: mingo@...nel.org, linux-kernel@...r.kernel.org, bsegall@...gle.com,
pjt@...gle.com, morten.rasmussen@....com,
vincent.guittot@...aro.org, dietmar.eggemann@....com
Subject: Re: [PATCH v4 3/5] sched/fair: Skip detach sched avgs for new task
when changing task groups
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);
> /*
Powered by blists - more mailing lists