Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp661114pxb; Tue, 5 Apr 2022 17:44:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMBRHP7wUNJVfs1EIJQy8cxdM7uklKUhy7/E4u08F41PzICk/LpmUeJNV287TACNNxSdyn X-Received: by 2002:a05:6402:198:b0:410:83e3:21d7 with SMTP id r24-20020a056402019800b0041083e321d7mr6244789edv.159.1649205882004; Tue, 05 Apr 2022 17:44:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649205881; cv=none; d=google.com; s=arc-20160816; b=q/rRA5t6s466hYWCgdoc/kIVJFAGOgJj+AqWg7AXMqYSQ3oTnakXNgC/f6PDldKYCk HaAgCtNvO+QU5tdWQZ1AzKB0NNLZTxWo1blOiS9TowCTSUBV4X8iHP80oFsVNwtDdsWi k8PEVxCE2NY4OjGjFummTBS4YTU4Omvv7rX0ZqSB2KcMBbk1kt3VxHO5y3oscXi1es8L +3VsgdkXkKxaSYLMxpWmPpjJOGj6ijknAHy/e3unQ9dlX17K87KgF50Tbe3T//XsIlng SAEMcmqztoo/phTaYKlWJDNO5YYlU74S7+IrY/cV3zNywrMChxQi2tYEsKhpdJAC8bzZ 0+rg== 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=uOKNLZmmc/rZMBtYySh7fT+o5YZw1vEH5F0ALtkHwREI3CdmXqsx4g9n7jUbUdwMgx GCBaEXLViz7865skBW038txTl7I1qoEF3/RFvS6F/tWW6WHl2DUtu5DHGhNdBhtfmC8T xvDalt8ETSUrWmh+GL/WwvuwfNDWpooqyF8DrfF+NwGzVyo05RM2HlQv/Sie133ffcHv Vc1zWgK8x1/GC4Wy3MOU6iKQLLoR+RubEN6xolJzZJvWYvf/EV0LSlivLS8Nu004yaFs mIoqejpS5WS16J0M2mZP7bvhUQ05XqwNyk6Bmn7QKYhiZO2TfejgMEMkN7mKyslgazh4 R4bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=P8uxzZo0; 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 w10-20020a509d8a000000b00419101e3899si10362659ede.485.2022.04.05.17.44.17; Tue, 05 Apr 2022 17:44:41 -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=P8uxzZo0; 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 S1384924AbiDEPPJ (ORCPT + 99 others); Tue, 5 Apr 2022 11:15:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346515AbiDEJpJ (ORCPT ); Tue, 5 Apr 2022 05:45:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5953DA6F4; Tue, 5 Apr 2022 02:30:53 -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 ams.source.kernel.org (Postfix) with ESMTPS id 4EA56B81CB4; Tue, 5 Apr 2022 09:30:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F2A3C385A0; Tue, 5 Apr 2022 09:30:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151051; bh=Bs37qhupQrzrwShQLMKh2eR5EW+wmQdn3FX3+6XNFbM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P8uxzZo0gUjnttNn0MGIILS+q3DS2ukkZrPK2UP+X1gALWztrwe7aGv65wq79Mg9f Pxzs6UaKLsTaLlrVElNqpb0eOtyHN06cDrWphYYsfNinYlh9otS1YmgAIRUdPqzAlw z4M2wRoTL/71lJvkIQo5fPEmbJmAFC/C9R1nOBfY= 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.15 249/913] sched/uclamp: Fix iowait boost escaping uclamp restriction Date: Tue, 5 Apr 2022 09:21:51 +0200 Message-Id: <20220405070347.320837737@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@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 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