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:	Fri, 21 Jun 2013 19:09:18 +0800
From:	Alex Shi <seakeel@...il.com>
To:	Lei Wen <adrian.wenl@...il.com>
CC:	Paul Turner <pjt@...gle.com>, Ingo Molnar <mingo@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Borislav Petkov <bp@...en8.de>,
	Namhyung Kim <namhyung@...nel.org>,
	Mike Galbraith <efault@....de>,
	Morten Rasmussen <morten.rasmussen@....com>,
	Vincent Guittot <vincent.guittot@...aro.org>,
	Preeti U Murthy <preeti@...ux.vnet.ibm.com>,
	Viresh Kumar <viresh.kumar@...aro.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Mel Gorman <mgorman@...e.de>, Rik van Riel <riel@...hat.com>,
	Michael Wang <wangyun@...ux.vnet.ibm.com>,
	Jason Low <jason.low2@...com>,
	Changlong Xie <changlongx.xie@...el.com>, sgruszka@...hat.com,
	Frédéric Weisbecker <fweisbec@...il.com>
Subject: Re: [patch v8 4/9] sched: fix slept time double counting in enqueue
 entity


>>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>>> index c61a614..9640c66 100644
>>> --- a/kernel/sched/fair.c
>>> +++ b/kernel/sched/fair.c
>>> @@ -5856,7 +5856,8 @@ static void switched_from_fair(struct rq *rq,
>>> struct task_struct *p)
>>>         */
>>>         if (p->se.avg.decay_count) {
>>>                 struct cfs_rq *cfs_rq = cfs_rq_of(&p->se);
>>> -               __synchronize_entity_decay(&p->se);
>>> +               p->se.avg.last_runnable_update +=
>>> +                               __synchronize_entity_decay(&p->se);
>>
>> it is not needed, since the last_runnable_update will be reset if it
>> will be switched to fair.
> 
> When it is backed to fair class, the only thing scheduler would do
> is to check whether it could preempt current running task, so
> where to reset the last_runnable_update?

here, when the task enqueue to cfs_rq.
avg.decay_count == 0, so the last line will reset last_runnable_update.

Anyway, you may consider to add a comment in the function, since it is bit hard
to understand for you.

---
/* Add the load generated by se into cfs_rq's child load-average */
static inline void enqueue_entity_load_avg(struct cfs_rq *cfs_rq,
                                                  struct sched_entity *se,
                                                  int wakeup)
{
        /*
         * We track migrations using entity decay_count <= 0, on a wake-up
         * migration we use a negative decay count to track the remote decays
         * accumulated while sleeping.
         */
        if (unlikely(se->avg.decay_count <= 0)) {
                se->avg.last_runnable_update = rq_of(cfs_rq)->clock_task;

> 
> Thanks,
> Lei
> 
>>
>> --
>> Thanks
>>     Alex


-- 
Thanks
    Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ