From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752107AbcFWVVx (ORCPT ); Thu, 23 Jun 2016 17:21:53 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:16181 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751040AbcFWVVw (ORCPT ); Thu, 23 Jun 2016 17:21:52 -0400 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Thu, 23 Jun 2016 14:20:53 -0700 Message-ID: <576C52B0.5080504@nvidia.com> Date: Thu, 23 Jun 2016 14:20:48 -0700 From: Sai Gurrappadi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Morten Rasmussen , , CC: , , , , , Peter Boonstoppel Subject: Re: [PATCH v2 11/13] sched/fair: Avoid pulling tasks from non-overloaded higher capacity groups References: <1466615004-3503-1-git-send-email-morten.rasmussen@arm.com> <1466615004-3503-12-git-send-email-morten.rasmussen@arm.com> In-Reply-To: <1466615004-3503-12-git-send-email-morten.rasmussen@arm.com> X-NVConfidentiality: public Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.187.121] X-ClientProxiedBy: HQMAIL102.nvidia.com (172.18.146.10) To HQMAIL101.nvidia.com (172.20.187.10) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Morten, On 06/22/2016 10:03 AM, Morten Rasmussen wrote: [...] > > +/* > + * group_smaller_cpu_capacity: Returns true if sched_group sg has smaller > + * per-cpu capacity than sched_group ref. > + */ > +static inline bool > +group_smaller_cpu_capacity(struct sched_group *sg, struct sched_group *ref) > +{ > + return sg->sgc->max_capacity * capacity_margin < > + ref->sgc->max_capacity * 1024; > +} > + > static inline enum > group_type group_classify(struct sched_group *group, > struct sg_lb_stats *sgs) > @@ -6892,6 +6903,19 @@ static bool update_sd_pick_busiest(struct lb_env *env, > if (sgs->avg_load <= busiest->avg_load) > return false; > > + if (!(env->sd->flags & SD_ASYM_CPUCAPACITY)) > + goto asym_packing; > + > + /* Candidate sg has no more than one task per cpu and has > + * higher per-cpu capacity. Migrating tasks to less capable > + * cpus may harm throughput. Maximize throughput, > + * power/energy consequences are not considered. > + */ > + if (sgs->sum_nr_running <= sgs->group_weight && > + group_smaller_cpu_capacity(sds->local, sg)) > + return false; > + > +asym_packing: What about the case where IRQ/RT work reduces the capacity of some of these bigger CPUs? sgc->max_capacity might not necessarily capture that case. Thanks, -Sai