Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030471Ab3FUJSX (ORCPT ); Fri, 21 Jun 2013 05:18:23 -0400 Received: from mail-la0-f49.google.com ([209.85.215.49]:39765 "EHLO mail-la0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030451Ab3FUJSV (ORCPT ); Fri, 21 Jun 2013 05:18:21 -0400 MIME-Version: 1.0 In-Reply-To: <51C4152E.60906@gmail.com> References: <1370589652-24549-1-git-send-email-alex.shi@intel.com> <1370589652-24549-5-git-send-email-alex.shi@intel.com> <51BF2E37.5040400@intel.com> <51C318D6.4090601@gmail.com> <51C3BCE1.1080405@gmail.com> <51C4152E.60906@gmail.com> Date: Fri, 21 Jun 2013 17:18:19 +0800 Message-ID: Subject: Re: [patch v8 4/9] sched: fix slept time double counting in enqueue entity From: Lei Wen To: Alex Shi Cc: Paul Turner , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Andrew Morton , Borislav Petkov , Namhyung Kim , Mike Galbraith , Morten Rasmussen , Vincent Guittot , Preeti U Murthy , Viresh Kumar , LKML , Mel Gorman , Rik van Riel , Michael Wang , Jason Low , Changlong Xie , sgruszka@redhat.com, =?ISO-8859-1?Q?Fr=E9d=E9ric_Weisbecker?= Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1562 Lines: 47 Alex, On Fri, Jun 21, 2013 at 4:56 PM, Alex Shi wrote: > On 06/21/2013 10:50 AM, Lei Wen wrote: >> I see your point... I made the mistake that update the wrong patch... >> Please help check this one. >> >> commit 5fc3d5c74f8359ef382d9a20ffe657ffc237c109 >> Author: Lei Wen >> Date: Thu Jun 20 10:43:59 2013 +0800 >> >> sched: fix potential twice decay issue >> >> Signed-off-by: Lei Wen >> >> 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? Thanks, Lei > > -- > Thanks > Alex -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/