Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161351Ab3FUCkd (ORCPT ); Thu, 20 Jun 2013 22:40:33 -0400 Received: from mail-pb0-f49.google.com ([209.85.160.49]:43314 "EHLO mail-pb0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161067Ab3FUCkc (ORCPT ); Thu, 20 Jun 2013 22:40:32 -0400 Message-ID: <51C3BCE1.1080405@gmail.com> Date: Fri, 21 Jun 2013 10:39:29 +0800 From: Alex Shi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: Lei Wen 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?= Subject: Re: [patch v8 4/9] sched: fix slept time double counting in enqueue entity 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> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2394 Lines: 74 On 06/21/2013 10:30 AM, Lei Wen wrote: > Hi Alex, > > On Thu, Jun 20, 2013 at 10:59 PM, Alex Shi 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. > > 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/