Received: by 10.223.176.46 with SMTP id f43csp2215663wra; Thu, 25 Jan 2018 06:41:06 -0800 (PST) X-Google-Smtp-Source: AH8x2260xhBge+2aquuPHDzcge6ywQccvZ7TpSbATNyNvg19jLxv4SatlSHyUT3YPIfXCDmrLFs8 X-Received: by 10.101.77.8 with SMTP id i8mr13627714pgt.308.1516891266776; Thu, 25 Jan 2018 06:41:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516891266; cv=none; d=google.com; s=arc-20160816; b=ni+ZGj0wz/ePYc6/UZCl5l4NOaB+Tl7Pp/huhTvg5ogkYtxTyAwN/rcpNJdFZ08s4T OvPf+tH2kmp4SRQW/Ac6q+XrB1G1Pch5sEB+/0TELgV9G10KwhnHHFs0JAn+YU/rvQaW jR2fHk++e7CyVCkwOIFm2NiauK4Bd7TcjLWzaVf8yQ2h+0w2FYdfPGIx6hBziDIa72QA venS55v4+JwwQi9u9sFYZyP/aaTR+AGy+pk7bWXEcVW5gC3u62g33Ixm2nhXeUymtkyy Yr//dDhxROvu4bsnRAaXdSmrgW8wSx5rmAg+bhuAOtZeZAMBaKPmcCNomm6jzPR5VLcY iWFQ== 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:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=ZpJmkcy59YyWZBAiRgcDroysAknNeFbPe+LI+L3d7D4=; b=co8bgeV0W9OrmohN+7Gbu6EAn5c2QvUPqrSWrOrv1EVGXXs40TIfMx2b2/1icFdoDH kVHA7khMfLf90Ud1D34YrkuISd9wMcOxdemYkT5XwjfdLfU9+TBGAVRVCEsrrRmP5ZG3 4TjM9ujOCaIU91SxtQxpnSuRXMtaQ8otTtNwkxGoZLicyHSe3L9alwxhd3+gtjWayVBD XWBxJGMYwcwufZjsbg1Nu05wLfk+rXMi2RsU+QRfObStUDAjGFUoL/P1OPhszmXCsVAF n+CNP90PB3WPnM+4QM9vha0Erc99hA6KssUEmtTwohGuBcmVQUv5C/YiPTuppUUPv1SC ZNng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=kP4YLu4R; dkim=pass header.i=@codeaurora.org header.s=default header.b=iBtTB5Ct; 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 o3-v6si2076471plk.533.2018.01.25.06.40.52; Thu, 25 Jan 2018 06:41:06 -0800 (PST) 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=pass header.i=@codeaurora.org header.s=default header.b=kP4YLu4R; dkim=pass header.i=@codeaurora.org header.s=default header.b=iBtTB5Ct; 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 S1751356AbeAYOeI (ORCPT + 99 others); Thu, 25 Jan 2018 09:34:08 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:52758 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750980AbeAYOeG (ORCPT ); Thu, 25 Jan 2018 09:34:06 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2F45960A60; Thu, 25 Jan 2018 14:34:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516890846; bh=bzOn7FGUGcOInmZ6PX8ikAUSi0bA+FWrXrHLRnZyQ7c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kP4YLu4RPQxdi6j/rotm7CZdRacIyyNM1a/LHE6gmWpL5wZDP+GhIUsMVOSHRvice au9xYnv/YfheyPOdOHEmr+wxpzEn0KrJiiRwX+w7EXfQpxOBpTVh2g5dKrSGWz12QA EITaylLSMPS85jy3oRFlgYiarPFH0uDE6gCa1A5E= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from codeaurora.org (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: pkondeti@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 71E8A601D2; Thu, 25 Jan 2018 14:34:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516890845; bh=bzOn7FGUGcOInmZ6PX8ikAUSi0bA+FWrXrHLRnZyQ7c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iBtTB5CtxQD53In0FaXGQ3QnSWyOoCuFEZ3x8gc/4iM52SU9qktFmxY5+BKpB+nm0 pAG1p9B1+J8cEKViel+S+bPBrsyJNCIZuMqFQlRCF107KH617PA35v8M+S2kdJIoLl jFPhStMBt71/68i69uhSRPat4ShjrVxPXKWBhOoo= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 71E8A601D2 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=pkondeti@codeaurora.org Date: Thu, 25 Jan 2018 20:03:58 +0530 From: Pavan Kondeti To: Patrick Bellasi Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , Peter Zijlstra , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Paul Turner , Dietmar Eggemann , Morten Rasmussen , Juri Lelli , Todd Kjos , Joel Fernandes , Steve Muckle Subject: Re: [PATCH v3 2/3] sched/fair: use util_est in LB and WU paths Message-ID: <20180125143358.GE30677@codeaurora.org> References: <20180123180847.4477-1-patrick.bellasi@arm.com> <20180123180847.4477-3-patrick.bellasi@arm.com> <20180124113342.GD30677@codeaurora.org> <20180124193138.GB5739@e110439-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180124193138.GB5739@e110439-lin> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 24, 2018 at 07:31:38PM +0000, Patrick Bellasi wrote: > > > > + /* > > > + * These are the main cases covered: > > > + * - if *p is the only task sleeping on this CPU, then: > > > + * cpu_util (== task_util) > util_est (== 0) > > > + * and thus we return: > > > + * cpu_util_wake = (cpu_util - task_util) = 0 > > > + * > > > + * - if other tasks are SLEEPING on the same CPU, which is just waking > > > + * up, then: > > > + * cpu_util >= task_util > > > + * cpu_util > util_est (== 0) > > > + * and thus we discount *p's blocked utilization to return: > > > + * cpu_util_wake = (cpu_util - task_util) >= 0 > > > + * > > > + * - if other tasks are RUNNABLE on that CPU and > > > + * util_est > cpu_util > > > + * then we use util_est since it returns a more restrictive > > > + * estimation of the spare capacity on that CPU, by just considering > > > + * the expected utilization of tasks already runnable on that CPU. > > > + */ > > > + util_est = cpu_rq(cpu)->cfs.util_est_runnable; > > > + util = max(util, util_est); > > > + > > > + return util; > > I should instead clamp util before returning it! ;-) > > > May be a separate patch to remove the clamping part? > > No, I think we should keep cpu_util_wake clamped to not affect the existing > call sites. I just need to remove it where not needed (done) and add it where > needed (will do on the next iteration). cpu_util_wake() is called only from capacity_spare_wake(). There are no other callsites. The capacity_spare_wake() is clamping the return value of cpu_util_wake() to CPU capacity. The clamping is not needed, I think. -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.