Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4430919ioa; Wed, 27 Apr 2022 03:50:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0xzOMP/zcJMHDmTxpyN7dDtm4VkHuqDMH2LGzzgiA460fJaJsA8K8BIZRoTMqB/NQtqVe X-Received: by 2002:a17:902:8696:b0:15d:946:2f98 with SMTP id g22-20020a170902869600b0015d09462f98mr16614586plo.82.1651056630261; Wed, 27 Apr 2022 03:50:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651056630; cv=none; d=google.com; s=arc-20160816; b=Q7Mdc7rD+dlyykXHaNPE1p/O5VZOZLnHt1MMjM+qSq9n194eP4g+3vlhNi6aQ0EQP0 p1d0ZsiFGJWQUZYpfNa/ghNa7lVWqR3FipZeESkt452IhJq+n6akBeZv0xE0yy150IHx /cZeNhCI6W49ug8POUNyYeNh9mSGrHstV47YLRAh9AJW0DO44u5vUhMk2e/8mL8+7wwD vI+IF79KgZg7p8zPEdAKWFJ6q9DfKJ49l8a1r/d/jbDYuMslOL3rnhlv6bva6cyrOfdj 7bcvk0JivEvDxl5gBgGtbMErvFBcb1sStEcgJ0NvAcuPElnyc55V/daFVBgx+xPkUp8U OpzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=wTu/ePr1vW7PMrGg/kaG4YAJboLQKJTr3IQT8YwIPac=; b=XussTGhnNqZ7k9Ez+ECNyBtuaVP5X0TArbSOPfpFyfJhH+InkazfLvajzMllHmVsin omoz4Tw0o7+Hh9/3pNf8q3GoxM+5a2nh8RKbVwlXWmpNgCdPdfND5f+cJOVASiJ/M/Ep esvHRHxJEQ/gUKAmzSacNwXq3IpzBg8OWvof6PwaKZVQLxqlp4TfglYEbOxG6bZrEzvS +/Gtw80hZyljN75QIvjZuDeXU+bUwqZha6Xmy4ZjoVK+ukeimcpxjhOZsxXATTcyCqld jocVBECTah3n+f3B8Pnb6rjunyXZMZBGNHzthSyCLX6kRVTzrMbS3WfzbWChaP9WcdIb h4Rg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e26-20020a630f1a000000b003816043eec7si1210018pgl.188.2022.04.27.03.50.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 03:50:30 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C45A641A2A6; Wed, 27 Apr 2022 02:57:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350634AbiDZNJ4 (ORCPT + 99 others); Tue, 26 Apr 2022 09:09:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350640AbiDZNJx (ORCPT ); Tue, 26 Apr 2022 09:09:53 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 930AD62C4 for ; Tue, 26 Apr 2022 06:06:45 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 37FC123A; Tue, 26 Apr 2022 06:06:45 -0700 (PDT) Received: from airbuntu (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 87BAD3F774; Tue, 26 Apr 2022 06:06:43 -0700 (PDT) Date: Tue, 26 Apr 2022 14:06:27 +0100 From: Qais Yousef To: Vincent Guittot Cc: Xuewen Yan , Xuewen Yan , dietmar.eggemann@arm.com, lukasz.luba@arm.com, rafael@kernel.org, viresh.kumar@linaro.org, mingo@redhat.com, peterz@infradead.org, rostedt@goodmis.org, linux-kernel@vger.kernel.org, di.shen@unisoc.com Subject: Re: [PATCH] sched: Take thermal pressure into account when determine rt fits capacity Message-ID: <20220426130627.febddumioeffvtng@airbuntu> References: <20220407051932.4071-1-xuewen.yan@unisoc.com> <20220420135127.o7ttm5tddwvwrp2a@airbuntu> <20220421161509.asz25zmh25eurgrk@airbuntu> <20220425161209.ydugtrs3b7gyy3kk@airbuntu> <20220426093056.uxnsz4tv4vhvbipe@airbuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/26/22 12:06, Vincent Guittot wrote: > > Wouldn't this be expensive to have 3 loops? That was my other suggestion but > > wasn't sure the complexity was worth it. So I suggested handling the capacity > > inversion case only. > > 3 loops might be too expensive. I mainly want to make sure to > understand what should be done to fix Xuewen case without breaking > others. Then we can see how to optimize this in a reasonable number of > loop The generic solution is what I tried to outline before: > So if we want to handle this case, then we need to ensure the search returns > false only if > > 1. Thermal pressure results in real OPP to be omitted. > 2. Another CPU that can provide this performance level is available. > > Otherwise we should still fit it on this CPU because it'll give us the closest > thing to what was requested. And we can do this in 2 ways, 3 loops as you said, or by creating a fallback cpumask as we search so that by the end we can resolve to it if we didn't find the best fit. My only worry here is that Xuewen doesn't see thermal issues on mids, so testability is a problem. This generic solution will only help with the case of mids losing some OPPs at the top, then we can do better by selecting a big core instead of a medium (if not in capacity inversion itself). I *think* (and I don't feel strongly about it at all), checking for capacity inversion and bypassing that cpu, or only then consider its thermal pressure, is the right approach to take here until someone reports more woes due to thermal pressure. That said, the generic solution might not be that bad actually and I'm just being a bit conservative. So would be good to hear what others think. Thanks -- Qais Yousef