Received: by 10.192.165.156 with SMTP id m28csp1681069imm; Thu, 12 Apr 2018 01:24:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx48yzx5vIYsgyPfjze+Y33jb7uhfoVWpG0owqE4R7p+z+ckoLZfLV1QbUrcIqGH21qm0b4il X-Received: by 10.99.64.3 with SMTP id n3mr5903311pga.13.1523521491316; Thu, 12 Apr 2018 01:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523521491; cv=none; d=google.com; s=arc-20160816; b=qlvtAm5vBNCz5u0xO1hRC9kjtKVi/iu85S2zi/gacTmDedZIhBDZtPiJftI+4dtms2 s7eg+f/uP0li0gM4fItjAUrP3PGOMKla76cLemGsX/li0RYLG4Ol6RZdhxNntqInhCRU QGibi7ixuKBSdOJNIGEGW67eG3qjncrett5itKU2aQnjGC+hsOWI19Re7Uja8664hM3o 9UYf+wjDoADVprLFC3lBWjJnUdzeq3rS3IAm++ZoguHTy7scwWJMUopm+hTkkcDa3mjA jPxZb1TfQVXiN7aLN52w7KF/+vtPyXbQEVI3hDOalwDrL06tx4naki7DFosFlqIcEe00 Bn6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=E7+M0o8kmh96FKvxOW2vb0GAEDAJhTlb6QKU8J/+K9g=; b=dq4AljlIzwNHwtlr0j5400ejYqTrpLnPrmLnQJCPhxAe7F8QZzd1qN7/B7USxw8Ear X5nGA/iDfzMM5mHZFEl+xw6Wg1hS29QLYcvcZYTLolpGTHayMM3tFDRmzMhqbVO3AIcj AgQjjjUpkHFP2zUKPBv+rhj0S+eCbakQ8Syc8S3WipGxkPB4uR3sMhUVegdqsosa9Lzo zWO/WKHrHVpC3tPRfUCVZbPW2E/2aJHS1N+WPdScBxBRGrl8tu0SoA4PfJpVckQvBmXa 4aRt4khUGG+lbg1GaSGQ8HxOnZC1UwAhAshueesfKQ2eWE37F1WClzYE4EGEopces750 ysAQ== ARC-Authentication-Results: i=1; mx.google.com; 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 t15si1904225pgc.623.2018.04.12.01.24.14; Thu, 12 Apr 2018 01:24:51 -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; 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 S1752834AbeDLIUN (ORCPT + 99 others); Thu, 12 Apr 2018 04:20:13 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:58040 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751856AbeDLIUM (ORCPT ); Thu, 12 Apr 2018 04:20:12 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A8A991529; Thu, 12 Apr 2018 01:20:11 -0700 (PDT) Received: from [0.0.0.0] (e107985-lin.cambridge.arm.com [10.1.210.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EC5343F487; Thu, 12 Apr 2018 01:20:07 -0700 (PDT) Subject: Re: [RFC PATCH v2 1/6] sched/fair: Create util_fits_capacity() To: Viresh Kumar Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Quentin Perret , Thara Gopinath , linux-pm@vger.kernel.org, Morten Rasmussen , Chris Redpath , Patrick Bellasi , Valentin Schneider , "Rafael J . Wysocki" , Greg Kroah-Hartman , Vincent Guittot , Todd Kjos , Joel Fernandes , Juri Lelli , Steve Muckle , Eduardo Valentin References: <20180406153607.17815-1-dietmar.eggemann@arm.com> <20180406153607.17815-2-dietmar.eggemann@arm.com> <20180412070230.GV7671@vireshk-i7> From: Dietmar Eggemann Message-ID: <0184b049-9333-2b6b-09a0-bdb71f491e25@arm.com> Date: Thu, 12 Apr 2018 10:20:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180412070230.GV7671@vireshk-i7> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/12/2018 09:02 AM, Viresh Kumar wrote: > On 06-04-18, 16:36, Dietmar Eggemann wrote: >> The functionality that a given utilization fits into a given capacity >> is factored out into a separate function. >> >> Currently it is only used in wake_cap() but will be re-used to figure >> out if a cpu or a scheduler group is over-utilized. >> >> Cc: Ingo Molnar >> Cc: Peter Zijlstra >> Signed-off-by: Dietmar Eggemann >> --- >> kernel/sched/fair.c | 7 ++++++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c >> index 0951d1c58d2f..0a76ad2ef022 100644 >> --- a/kernel/sched/fair.c >> +++ b/kernel/sched/fair.c >> @@ -6574,6 +6574,11 @@ static unsigned long cpu_util_wake(int cpu, struct task_struct *p) >> return min_t(unsigned long, util, capacity_orig_of(cpu)); >> } >> >> +static inline int util_fits_capacity(unsigned long util, unsigned long capacity) >> +{ >> + return capacity * 1024 > util * capacity_margin; > > This changes the behavior slightly compared to existing code. If that > wasn't intentional, perhaps you should use >= here. You're right here ... Already on our v3 list. Thanks! The 'misfit' patch-set comes with a similar function task_fits_capacity() so we have to align on this one with this patch-set as well. [...]