Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp673682pxb; Tue, 5 Apr 2022 18:13:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwnBMahvIDV11qShIHfVvVMWIISDbbEOXUIv1h479+SvhTClCywtP2lE+mLFvh9oxWz7Qo X-Received: by 2002:a05:6a00:338e:b0:4fa:9015:af50 with SMTP id cm14-20020a056a00338e00b004fa9015af50mr6452119pfb.57.1649207615118; Tue, 05 Apr 2022 18:13:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649207615; cv=none; d=google.com; s=arc-20160816; b=kDG2TAqy1vnYW7YaykXI8yhLaGpReubDfNgT95OkZ9L9dxrxKHUHJWhygPRI+wPjs1 jIp0wpnkCpS/S4REZXqsqHwYWHJK+AoCQqTOg5CYb6ZIXC+L1Est62FLQyxomZZlvc+B ATDE8uUWxB/8i9oR/79v2TBmZsN/axWXNyAxBZPpAVLr8KbNDWeUwTMK1dEzlmz6M1/4 eo8mSXP89TQRUsQ5nMp66jqJuJkOGkh6TRf9PRiiiSXNzUiTODMp6NpbnwjNB1IaKvN+ fsiKXyzPHVaXty2N/kDXIqAAhn5a6dXsIFAqSw3qw7b5eDmKluJ9gSUcgX6e2/LnAHFF Jq3A== 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=YF0+J99CAORwf8aNQKHHUHDp46OucvQsllrvOaPXPgQ=; b=EgDRm+Wc/oWaLCwqOGQqkY7yXpoPQQJ7Efqfkuj2NGTlFFTgCs71/epu/0941AevYS IWN7BhCJratwInpv2E1/AyELJZE0ErcW0Q34A6vVosq+4Js8ndyKoiL7tqLw5CzlbL8J dNpiaMJku1yX4n86X4vqcPbFhg2dAugMU2Er2ZBNuqdDGgt2YPAla7EuIEsrIjQNv7Xo 6dS/Tv9tff4pXXU55JP2WtHrFYMut+k5JiGpF11zOBcWRdPdaTeXPWyHgmlGpnbSEIZh KRw5CBeStlXKpkKe5P4mSDEBdst2A1tGIdfClg04VTEmuB/1UNV4XMpgyRz1OtL0YCoB 2mhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gSdjmCgD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i10-20020a170902cf0a00b00153b2d16591si12948616plg.409.2022.04.05.18.13.20; Tue, 05 Apr 2022 18:13:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gSdjmCgD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234044AbiDEIMA (ORCPT + 99 others); Tue, 5 Apr 2022 04:12:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233504AbiDEH5N (ORCPT ); Tue, 5 Apr 2022 03:57:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB5A44B852; Tue, 5 Apr 2022 00:51:09 -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 9B16761728; Tue, 5 Apr 2022 07:51:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8C25C340EE; Tue, 5 Apr 2022 07:51:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649145064; bh=6u6dVmWOAc7he5mMg4R2E5sd6D/8PJLwEWyTO7PHVws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gSdjmCgDvrpuB0blTBpMk5hRdrd8VhV5/+kXWQTx0rIH5N2KTpedia3w1+GE0TUvS dNXoYfZgkJF948coa9JDRIw7n5KmAgY6uEti5iRomYkEU6sAcq6yjvsvDYncZRLeeE AwydMim4A/Dw4qLcYGbwpf/OU4wJmpGoZvVPXmk8= 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.17 0272/1126] sched/uclamp: Fix iowait boost escaping uclamp restriction Date: Tue, 5 Apr 2022 09:16:59 +0200 Message-Id: <20220405070415.594288251@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@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=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 62d98b09aaa5..6d65ab6e484e 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