From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751691AbcFNLL4 (ORCPT ); Tue, 14 Jun 2016 07:11:56 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:37496 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751140AbcFNLLz (ORCPT ); Tue, 14 Jun 2016 07:11:55 -0400 Date: Tue, 14 Jun 2016 12:11:52 +0100 From: Matt Fleming To: Yuyang Du Cc: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, bsegall@google.com, pjt@google.com, morten.rasmussen@arm.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com Subject: Re: [PATCH v5 1/5] sched/fair: Clean up attach_entity_load_avg() Message-ID: <20160614111152.GG2658@codeblueprint.co.uk> References: <1465427754-28897-1-git-send-email-yuyang.du@intel.com> <1465427754-28897-2-git-send-email-yuyang.du@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1465427754-28897-2-git-send-email-yuyang.du@intel.com> User-Agent: Mutt/1.5.24+41 (02bc14ed1569) (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 09 Jun, at 07:15:50AM, Yuyang Du wrote: > attach_entity_load_avg() is called (indirectly) from: > > - switched_to_fair(): switch between classes to fair > - task_move_group_fair(): move between task groups > - enqueue_entity_load_avg(): enqueue entity > > Only in switched_to_fair() is it possible that the task's last_update_time > is not 0 and therefore the task needs sched avgs update, so move the task > sched avgs update to switched_to_fair() only. In addition, the code is > refactored and code comments are updated. > > No functionality change. > > Signed-off-by: Yuyang Du > --- > kernel/sched/fair.c | 43 ++++++++++++++++++++----------------------- > 1 file changed, 20 insertions(+), 23 deletions(-) Looks OK to me and makes the code easier to understand. Chasing ->avg.last_update_time values is tricky at the best of times. Reviewed-by: Matt Fleming