Received: by 10.192.165.156 with SMTP id m28csp560716imm; Wed, 11 Apr 2018 03:50:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Y36oP4v6MLKTVJ4bgTwyjq4iUUklKsA1OfMv/f9DnwEnZnw2tC5cqkoAvT/K+9GfYJCkn X-Received: by 2002:a17:902:820d:: with SMTP id x13-v6mr4446530pln.225.1523443801843; Wed, 11 Apr 2018 03:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523443801; cv=none; d=google.com; s=arc-20160816; b=mJqJU7FVLF6v/jb0m4Iqorp2iRzqfInibrllDdh0lOYvxm7BqzsFTiSGilQ64zahiB mntmiAsiFRmr2H33tMVPK6l/F8coMGUxZI6S8SHJ88Li+WxAUhLY69ARgyENI96b19m+ YcrGV4r19CTRN8wpW8fv3n3V6xS/MmQDvhP6/SxJ/OVO2QbTT7T+hA3/Jh8lb1nu/PSE NhZJr0An+1RoihBwuC/2OETYfbmyMZnfBNEWumylFE5XFlbYlBaH1PAAKziEWHtbX0uL 6YuKdpeYbsPxQIkWfocJPcH4KjTBWQqFsABt1R8Vwd7DuqLWGNATjYYNpvBpA5DQ6H8b HeJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=5hgEQevGVvazkL4XdtWJB94BKis+Sz4piy2yqONZfr0=; b=rBAfvGeNl9WowCtDDhWvYe6cPJ3HCnS7kUjq/RE2NqkhfX1E4T2OzfzMdxIpvH1xLR NKLobIelm06hOtfZPbqB/v+NEQmfXoI9KgSkZ5tSTB/YcPKLxRSW+jMakyzkrgjc3Tqk zTRj8Uf4Ghxc6YODQG33xHZs52kRmvJMz1WaaP/8vESgw5uCG9JysAmZkRzGUxHP9foC GL3CzkFhEnW/3OTcM8cDyXd53M3vF1O2euDrLIPcSmtJJPzE4/XBNL5puIe1olspmpd8 7v59p4oizxmb8brsVSFOqfCfEVaENf9irbt42+QRiG4eKv4SJlEakeNfaAvqQkp2WJ1I u9mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=UgFuU7cV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x74si675503pfi.371.2018.04.11.03.49.25; Wed, 11 Apr 2018 03:50:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=UgFuU7cV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752668AbeDKKp3 (ORCPT + 99 others); Wed, 11 Apr 2018 06:45:29 -0400 Received: from merlin.infradead.org ([205.233.59.134]:45494 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750819AbeDKKp2 (ORCPT ); Wed, 11 Apr 2018 06:45:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5hgEQevGVvazkL4XdtWJB94BKis+Sz4piy2yqONZfr0=; b=UgFuU7cVffcXnCEJMSHozG0a3 C5nVP0v4EM9PuCBoK5AqpldJHoz4ix4fr5N7O5pGHzKMmXMCgv+Ex2n6PKhbUeJ9C5RuG4OM2ZFHy NRMKxqpVAGga3aOJG+chkNH0aKFElAGlZfwLXrZCyXYQLX56ezE/kXY7EHDn0ol+hjqIOOWcK97FP OnjZs58/ZAmQvMucA3q3/WFLzvV2Pu7zW2Foz/7zU+XMLL6dE4ynN49z+A4tS1vzxZAwobAmhaBQG v4bCakPRpk0WbBhz1RndiGuu9EvB4JIMgUdXwZ9Mi3VQtgFDM23Ty6F1/Iln0CdtQoNF1xrJfei0M I+xtUBxRA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1f6DFh-0002Sw-NC; Wed, 11 Apr 2018 10:45:21 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 54C8E2029908D; Wed, 11 Apr 2018 12:45:20 +0200 (CEST) Date: Wed, 11 Apr 2018 12:45:20 +0200 From: Peter Zijlstra To: Morten Rasmussen Cc: mingo@redhat.com, valentin.schneider@arm.com, dietmar.eggemann@arm.com, vincent.guittot@linaro.org, gaku.inami.xh@renesas.com, linux-kernel@vger.kernel.org Subject: Re: [PATCHv2 2/7] sched/fair: Add group_misfit_task load-balance type Message-ID: <20180411104520.GG4043@hirez.programming.kicks-ass.net> References: <1521125224-15434-1-git-send-email-morten.rasmussen@arm.com> <1521125224-15434-3-git-send-email-morten.rasmussen@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1521125224-15434-3-git-send-email-morten.rasmussen@arm.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 15, 2018 at 02:46:59PM +0000, Morten Rasmussen wrote: > +static inline unsigned long task_util(struct task_struct *p); > +static inline int task_fits_capacity(struct task_struct *p, long capacity) > +{ > + return capacity * 1024 > task_util(p) * capacity_margin; > +} > + > +static inline void update_misfit_status(struct task_struct *p, struct rq *rq) > +{ > + if (!static_branch_unlikely(&sched_asym_cpucapacity)) > + return; > + > + if (!p) { > + rq->misfit_task_load = 0; > + return; > + } > + > + if (task_fits_capacity(p, capacity_of(cpu_of(rq)))) { > + rq->misfit_task_load = 0; > + return; > + } > + > + rq->misfit_task_load = task_h_load(p); > +} So RT/IRQ pressure can also cause misfit.. > @@ -7972,6 +8005,10 @@ static inline void update_sg_lb_stats(struct lb_env *env, > */ > if (!nr_running && idle_cpu(i)) > sgs->idle_cpus++; > + > + if (env->sd->flags & SD_ASYM_CPUCAPACITY && > + !sgs->group_misfit_task_load && rq->misfit_task_load) > + sgs->group_misfit_task_load = rq->misfit_task_load; > } Should we not look for the biggest misfit instead of the first? > > /* Adjust by relative CPU capacity of the group */