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]
Message-ID: <CALZhoSR8pLfqO+XfEfHB3-UuV5_xu=AV2mCf2BQgaaQoWd-tbw@mail.gmail.com>
Date:	Fri, 21 Jun 2013 10:50:32 +0800
From:	Lei Wen <adrian.wenl@...il.com>
To:	Alex Shi <seakeel@...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

Alex,

On Fri, Jun 21, 2013 at 10:39 AM, Alex Shi <seakeel@...il.com> wrote:
> On 06/21/2013 10:30 AM, Lei Wen wrote:
>> Hi Alex,
>>
>> On Thu, Jun 20, 2013 at 10:59 PM, Alex Shi <seakeel@...il.com> wrote:
>>> On 06/20/2013 10:46 AM, Lei Wen wrote:
>>>>
>>>>
>>>> But here I have a question, there is another usage of __synchronzie_entity_decay
>>>> in current kernel, in the switched_from_fair function.
>>>>
>>>> If task being frequently switched between rt and fair class, would it
>>>> also bring the
>>>> redundant issue? Do we need patch like below?
>>>>
>>>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>>>> index b5408e1..9640c66 100644
>>>> --- a/kernel/sched/fair.c
>>>> +++ b/kernel/sched/fair.c
>>>> @@ -5856,7 +5856,7 @@ 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);
>>>> -               se->avg.last_runnable_update +=
>>>> +               p->se.avg.last_runnable_update +=
>>>
>>> what tree does this patch base on?
>>
>> I create the patch based on v3.9 kernel.
>> If it is ok, I could create a formal one based on latest kernel.
>
> In the linus tree, the first commit which introduced
> __synchronize_entity_decay(&p->se) here is
> 9ee474f55664ff63111c843099d365e7ecffb56f
> +
> +#if defined(CONFIG_FAIR_GROUP_SCHED) && defined(CONFIG_SMP)
> +       /*
> +       * Remove our load from contribution when we leave sched_fair
> +       * and ensure we don't carry in an old decay_count if we
> +       * switch back.
> +       */
> +       if (p->se.avg.decay_count) {
> +               struct cfs_rq *cfs_rq = cfs_rq_of(&p->se);
> +               __synchronize_entity_decay(&p->se);
> +               subtract_blocked_load_contrib(cfs_rq,
> +                               p->se.avg.load_avg_contrib);
> +       }
> +#endif
>  }
>
> And it is never changed from then on. So your code must based on a
> incorrect kernel. please do a double check.

I see your point... I made the mistake that update the wrong patch...
Please help check this one.

commit 5fc3d5c74f8359ef382d9a20ffe657ffc237c109
Author: Lei Wen <leiwen@...vell.com>
Date:   Thu Jun 20 10:43:59 2013 +0800

    sched: fix potential twice decay issue

    Signed-off-by: Lei Wen <leiwen@...vell.com>

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);
                subtract_blocked_load_contrib(cfs_rq,
                                p->se.avg.load_avg_contrib);
        }

Thanks,
Lei


>>
>> Thanks,
>> Lei
>>
>>>>                                 __synchronize_entity_decay(&p->se);
>>>>                 subtract_blocked_load_contrib(cfs_rq,
>>>>                                 p->se.avg.load_avg_contrib);
>>>
>>>
>>> --
>>> 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