Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp654258pxb; Tue, 5 Apr 2022 17:28:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywVxfiX1DB8ASX2MdYcpvmRGvgnlaLLJTExE5oIwHLArbETYrhN2Q0NLbLe14N5AJBeOrK X-Received: by 2002:a17:90a:e7ce:b0:1c7:bf82:27c0 with SMTP id kb14-20020a17090ae7ce00b001c7bf8227c0mr6951348pjb.88.1649204901781; Tue, 05 Apr 2022 17:28:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649204901; cv=none; d=google.com; s=arc-20160816; b=KuBZ/GsEzX1Qsb0DQKGFTyWyY3WIOED15HszBRGmvdYAzLypl4TC0ZLEAHxMw5zd+L 8hR3ej7hLem4RpDN2Zdp45AopUP1kk+xQ3s5y9wpLA95nAf1aaAEhwlIaJSu9Ohk/sJO XtaeCJa8Sv4DZTbhSOFMAmYYlTJElqitQzszurox69gEDo1ZdHop/ODxzbvtZfM7kcRZ /zN+B8YK+5tFJTKa2D99cjVsWNeR+/IV2ZMjIYormblajDWD9YczFD1crhRgF6jGq7gf szl7BPaPlTtd66avWtO0vvuKGC6mlJc8hnb0D9JlOTMmVPpns0+dc39Yr1M2aNfTz3ia 5Qvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3Npp8nauj2fC1RXm6RZtiD7pu/se1QVxKQTcBUnZ2o0=; b=SCPCdMWSxNFTrITSSVwHJBk1VZmEZvAmG77tel7bt6aXPABBf2KxvNOH8AL+u7ofox bNcm7eL5pe2iTgAH5apAxw3bO+Isv/XLU5m1z1U81jlIo5tS2UhvG9ZMwrMbL8dEAoCx SZnR3HdXd7PHLspCu5h7OOHm0m6JZ1eLRe8YSvHuBsAtL4Ta0JWcwJNohFWDzq6xnBPf wN3+zYUTE0P27eA0VWajTlFETXOJBUq4DyHc7VD7NA1Y91yUruDW2NGSx4mggQX/AaK/ Ju0rPqUjbbOjuHUKRQ+2QkK7JZpwMz2GHbiuaAlLLyEhdxFxRg0flrY3PmlOUxKclEDO Dt3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iac2mOJf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b7-20020a6567c7000000b003816043efa9si14823547pgs.414.2022.04.05.17.28.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 17:28:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iac2mOJf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B9EDD1704F0; Tue, 5 Apr 2022 17:14:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381340AbiDEMOp (ORCPT + 99 others); Tue, 5 Apr 2022 08:14:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244779AbiDEIwi (ORCPT ); Tue, 5 Apr 2022 04:52:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E1AC5FD7; Tue, 5 Apr 2022 01:43:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 197BF60FFC; Tue, 5 Apr 2022 08:43:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21D8FC385A1; Tue, 5 Apr 2022 08:43:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649148224; bh=Bs37qhupQrzrwShQLMKh2eR5EW+wmQdn3FX3+6XNFbM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iac2mOJfQD7kJkADt/LJKtIjvYovFJKi624IHm8AtVI21tnjfSrf41fS1lOdeSGsb 0mDtg8Jp8YyGt9QOL8/F1BNOGhpDkAiFV4uJCcSHfmqn1MvLeeEkB7L55MmDRHHLVu Qj/E5noAOsYvrrT/89g89/KqltJpnLrylGrItZmQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qais Yousef , "Peter Zijlstra (Intel)" , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.16 0262/1017] sched/uclamp: Fix iowait boost escaping uclamp restriction Date: Tue, 5 Apr 2022 09:19:35 +0200 Message-Id: <20220405070402.040322476@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 From: Qais Yousef [ Upstream commit d37aee9018e68b0d356195caefbb651910e0bbfa ] iowait_boost signal is applied independently of util and doesn't take into account uclamp settings of the rq. An io heavy task that is capped by uclamp_max could still request higher frequency because sugov_iowait_apply() doesn't clamp the boost via uclamp_rq_util_with() like effective_cpu_util() does. Make sure that iowait_boost honours uclamp requests by calling uclamp_rq_util_with() when applying the boost. Fixes: 982d9cdc22c9 ("sched/cpufreq, sched/uclamp: Add clamps for FAIR and RT tasks") Signed-off-by: Qais Yousef Signed-off-by: Peter Zijlstra (Intel) Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20211216225320.2957053-3-qais.yousef@arm.com Signed-off-by: Sasha Levin --- kernel/sched/cpufreq_schedutil.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index e7af18857371..7f6bb37d3a2f 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -289,6 +289,7 @@ static void sugov_iowait_apply(struct sugov_cpu *sg_cpu, u64 time) * into the same scale so we can compare. */ boost = (sg_cpu->iowait_boost * sg_cpu->max) >> SCHED_CAPACITY_SHIFT; + boost = uclamp_rq_util_with(cpu_rq(sg_cpu->cpu), boost, NULL); if (sg_cpu->util < boost) sg_cpu->util = boost; } -- 2.34.1