From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 134D8C4167B for ; Fri, 3 Nov 2023 14:50:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231637AbjKCOud (ORCPT ); Fri, 3 Nov 2023 10:50:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbjKCOub (ORCPT ); Fri, 3 Nov 2023 10:50:31 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 79F9D13E for ; Fri, 3 Nov 2023 07:50:28 -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 0AEB22F4; Fri, 3 Nov 2023 07:51:11 -0700 (PDT) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 97ADF3F64C; Fri, 3 Nov 2023 07:50:26 -0700 (PDT) Message-ID: Date: Fri, 3 Nov 2023 15:50:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 6/6] sched/uclamp: Simplify uclamp_eff_value() Content-Language: en-US To: Hongyan Xia , Ingo Molnar , Peter Zijlstra , Vincent Guittot , Juri Lelli Cc: Qais Yousef , Morten Rasmussen , Lukasz Luba , Christian Loehle , linux-kernel@vger.kernel.org References: <6006f27e2cae8c5f8b00987aa04ee29317aabcc1.1696345700.git.Hongyan.Xia2@arm.com> From: Dietmar Eggemann In-Reply-To: <6006f27e2cae8c5f8b00987aa04ee29317aabcc1.1696345700.git.Hongyan.Xia2@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/10/2023 11:04, Hongyan Xia wrote: > From: Hongyan Xia > > The commit > > sched: Remove all uclamp bucket logic > > removes uclamp_{inc/dec}() functions, so now p->uclamp contains the s/uclamp_{inc/dec}/uclamp_rq_{inc/dec} > correct values all the time after a update_uclamp_active() call, and s/update_uclamp_active()/uclamp_update_active() > there's no need to toggle the boolean `active` after an update. As a > result, this function is fairly simple now and can live as a static > inline function. [...] > -unsigned long uclamp_eff_value(struct task_struct *p, enum uclamp_id clamp_id) > -{ > - if (!uclamp_is_used() || !p->uclamp[clamp_id].active) > - return uclamp_none(clamp_id); > - > - return p->uclamp[clamp_id].value; > -} > - Is there still a need for p->uclamp[clamp_id].active ? Does uclamp_eff_value() ever get called with !active ? And why do we have to set uclamp default values in case (!used || !active)? Shouldn't they be set already in this situation? [...]