Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp535506rdf; Fri, 3 Nov 2023 07:51:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6y2J0JTaDFpMokKzF1P0d5ctAcv8r/GPuJ7uSQRnaRZWhD8pQYXAEAN8vDgMQpo7snTOP X-Received: by 2002:aa7:86cf:0:b0:691:27b:15b4 with SMTP id h15-20020aa786cf000000b00691027b15b4mr3325653pfo.5.1699023075971; Fri, 03 Nov 2023 07:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699023075; cv=none; d=google.com; s=arc-20160816; b=ife6Tm6rBmeq/06h4xklWq2L8WS/ecXUpVDBCgOv1n5fm99NcvmqNAho1Ees5u1FWd JPL6VjlF91qiGA+5/9YdhXtAagTW3WuF1BmvwfHuqWJzpUwCS4WED28HlaEZxW4fiImB 7prum2b1D34NEe4tH7Bx1XshwEN6qiormeeFubF3YmJlIuZz7Lo+SUtpviTD6WmCHQjg a7uLuU9fUUjapAnqbvhMsTmkA47iDquuxYxowYa2UK9LkBQ7jSMR6amWuWVPqUMcSref fR7JHNM9YO6KuXjElAZ2Z4sr+O78YCWAmU22p2lQQlwjDmVi/2x/QLXpF1mYykRr2z50 SnoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=KkS9bdEej+5Py7QJl4AQoPvreyJCtiOGBYFUfmURpFY=; fh=AfLL/DKK2gQQEoZBzmnH4pb//TwGt2KTQ6T6ssunXrA=; b=zxLpzyUJsjq8ldkGwdr4o5mt4Smpzxpue6I0qwXvavEcAZyBQ1wFeTiLPLBuwRP9a5 Tb46xTgj/dh+haLmwCzErfBMk67a+wa8SJN8+qqBDLYDy0X5HbDWLLsXCPqsfgvbs3nc rAtz6FkpQkjBIS2iI+13wEfc45k2W/hjpibob+R4j7S9SOpxcfg0vHBZ0VFgm8XHJdkr GS6TnSHC7hXvFHYuzLHLGcMj6CobJgMoCWYPeTpUVtv1K5631U/ILr9aWJxfaghGfTcD MpLiplOo7xEAfUGq7uSZlZMncHZsm/GeFT6sDPwtaAKIyZeJG77XytCxNPbMbE2HPHBe nHcw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id l192-20020a6391c9000000b005b92cefe42csi1627320pge.97.2023.11.03.07.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 07:51:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C26D780A311E; Fri, 3 Nov 2023 07:50:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230052AbjKCOuc (ORCPT + 99 others); Fri, 3 Nov 2023 10:50:32 -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 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 03 Nov 2023 07:50:47 -0700 (PDT) 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? [...]