lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 16 Jun 2016 09:00:41 +0800
From:	Yuyang Du <yuyang.du@...el.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Vincent Guittot <vincent.guittot@...aro.org>,
	Ingo Molnar <mingo@...nel.org>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	Mike Galbraith <umgwanakikbuti@...il.com>,
	Benjamin Segall <bsegall@...gle.com>,
	Paul Turner <pjt@...gle.com>,
	Morten Rasmussen <morten.rasmussen@....com>,
	Dietmar Eggemann <dietmar.eggemann@....com>,
	Matt Fleming <matt@...eblueprint.co.uk>
Subject: Re: [PATCH v6 1/4] sched/fair: Fix attaching task sched avgs twice
 when switching to fair or changing task group

On Wed, Jun 15, 2016 at 05:22:17PM +0200, Peter Zijlstra wrote:
> On Wed, Jun 15, 2016 at 09:46:53AM +0200, Vincent Guittot wrote:
> > I still have concerned with this change of the behavior that  attaches
> > the task only when it is enqueued. The load avg of the task will not
> > be decayed between the time we move it into its new group until its
> > enqueue. With this change, a task's load can stay high whereas it has
> > slept for the last couple of seconds. Then, its load and utilization
> > is no more accounted anywhere in the mean time just because we have
> > moved the task which will be enqueued on the same rq.
> > A task should always be attached to a cfs_rq and its load/utilization
> > should always be accounted on a cfs_rq and decayed for its sleep
> > period
> 
> OK; so I think I agree with that.

Ok, I agree now. I think the following should fix (or sort out) the attach
twice problem Vincent discovered (SMP is needed, maybe move reset() into attach()).

static void task_move_group_fair(struct task_struct *p)
{
	detach_task_cfs_rq(p);
	set_task_rq(p, task_cpu(p));
	attach_task_cfs_rq(p);
	/*
	 * If the cfs_rq's last_update_time is 0, attach the sched avgs
	 * won't be anything useful, as it will be decayed to 0 when any
	 * sched_entity is enqueued to that cfs_rq.
	 *
	 * On the other hand, if the cfs_rq's last_update_time is 0, we
	 * must reset the task's last_update_time to ensure we will attach
	 * the sched avgs when the task is enqueued.
	 */
	if (!cfs_rq_of(&p->se)->avg.last_update_time)
		reset_task_last_update_time(p);
	else
		attach_entity_load_avg(cfs_rq_of(&p->se), &p->se);
}

Vincent, could you please verify?

> Does the below (completely untested,
> hasn't even been near a compiler) look reasonable?
 
Goodness. But mine is also fired now. :)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ