From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754592AbcFHCOA (ORCPT ); Tue, 7 Jun 2016 22:14:00 -0400 Received: from mga02.intel.com ([134.134.136.20]:52372 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751212AbcFHCN7 (ORCPT ); Tue, 7 Jun 2016 22:13:59 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,436,1459839600"; d="scan'208";a="983007224" Date: Wed, 8 Jun 2016 02:16:54 +0800 From: Yuyang Du To: Vincent Guittot Cc: Peter Zijlstra , Ingo Molnar , linux-kernel , Benjamin Segall , Paul Turner , Morten Rasmussen , Dietmar Eggemann Subject: Re: [PATCH v4 2/5] sched/fair: Fix attaching task sched avgs twice when switching to fair or changing task group Message-ID: <20160607181654.GG8105@intel.com> References: <1465172441-27727-1-git-send-email-yuyang.du@intel.com> <1465172441-27727-3-git-send-email-yuyang.du@intel.com> <20160606190524.GD8105@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 07, 2016 at 10:09:14AM +0200, Vincent Guittot wrote: > >> A much more simple solution would be > >> to prevent last_update_time to be initialized with this special value. > >> We can initialize the last_update_time of a sched_entity to 1 as an > >> example which is easier than these changes. > > > > Then at least, we must differentiate CONFIG_FAIR_GROUP_SCHED and > > !CONFIG_FAIR_GROUP_SCHED. And I am not sure whether this is a simpler > > Why do you want to differentiate ? we already have > sa->last_update_time = 0; in init_entity_runnable_average. We just > have to change it by sa->last_update_time = 1; If !CONFIG_FAIR_GROUP_SCHED, we don't have task_move_group_fair(). If last_update_time != 0, we won't attach it for new task. Correct?