Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2581974lqb; Tue, 28 May 2024 04:43:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXgwimyMnXB15fuFimF3XW4rqARVpwdtTn1SbtsuaqWhiutbDlB6KT2Dh7+WPOW3ebZdVgyWPsarkp8VVjv5bWg/TC485x29Es53aHakA== X-Google-Smtp-Source: AGHT+IF+srHEEPRy/qTG0calnLau7ZuQQKFAnm7159sJZdHUhvL2CHr4TFRNoDN3Z6ResqBLJdOR X-Received: by 2002:a05:620a:24d3:b0:790:f18d:a4e4 with SMTP id af79cd13be357-794ab11268cmr1598049085a.58.1716896581928; Tue, 28 May 2024 04:43:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716896581; cv=pass; d=google.com; s=arc-20160816; b=e9rcIFIcyn87j/1wKZOgelbW8vO2uT64u4tsVnko7AKeUsSfgUxzXV0VoxKNCRHSR0 5zsO+0g95Uix1AcfVupX2b+iyotc/yOd9uyjlBUj2/ZiSCGzS8kOoKLA9dO3+IZSqO/x qjQnttiFr/W6Iwk3at5E5XBJfCJH17Gg6wtjGzfabEPLHBenVwvi9zL+WTHFVrkEd4iz NJKyigyES+7RCCRhsiNsAf/zy0+v+h/R3f4l4IAD6gr11pC39Si6ilBZPuWLHvqROo6R c9VN/ex29LzQ3k3shP67ZgpRem4ns/FvBjNq7psSjp3hMLPd5Hio/XI0qQhp4xI+4aAQ TPKA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=nyKU9jpy0gcRVWkovZFT/i6CyMxh8uT7+1D0ycXSRCk=; fh=tdY3RD71eVGyFr36motyabqJnjpt1q4YaYGxGQOLstc=; b=dr/rRkNt7WGV4nkd6dDxPLGiR/b6oD2QVHGUmb2tNw1779JWZ321sHTf/BL4LKb3Pj PWxb5z10zAmZ+ISHnEWLo6qyNQ98rhNnmI6gyn1CAvqosR/Nd17zDTdnxjKzsG+QVVDD +UgAx5nL6ADiJacCr9Wx0wLj06dlKUo4Bk2Z7f8uUS7jqlRLji7sFdOJUXGtNe0velG1 7zFq81P4og4IdEvqGE3Si11MW6n8Lhe2+U91Y5CNjIxORcYLgiVnJ1yojS/xNtI0qoFh sA/4w4YFhOSUGT71UK8wBSewFBU7yGjO3ReZloIR2Jq+37LZwn2Pe6OBq8rh9ii82XME ch5Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-192201-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192201-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794abcab76dsi959816185a.9.2024.05.28.04.43.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 04:43:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192201-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-192201-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192201-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9AF611C21CE0 for ; Tue, 28 May 2024 11:43:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9FA2416C848; Tue, 28 May 2024 11:42:56 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E91D16ABEA for ; Tue, 28 May 2024 11:42:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716896576; cv=none; b=UNWp7DXK3kqKyb/l24WH4Y+JDy4LOgqUTnCLnnsxXVtO2JHHOkYGc8duoh7FYrwTNHDY8bnRUS6oKcv1P0GNqc1Li44dkMCEjBp/ibzyKH0TxkUFe/0ZQFtH7GMccLIR3D/vaVsW6MyWZoUBwBEI3HD/suz4Q0/zf0jJeT+Mk7k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716896576; c=relaxed/simple; bh=S0VJJBbE5kOXZ/KL0cz9wUfOzpd6ZFwGTVuAidGHwU0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=h1RGXAnTc+UzcZMQdmxvYhW7+1MFAf/9RxWlZn3GGISHjjVT3V6kjJEVehDvjpllJ+qov/xj0CJZ/+Z+SaY9N+nWiU7xngtDjhGiG+jx4Rk4PfXBh+nwEYeTiu60TGU5f8lMQ0+lKepAI2neGlUqWUL4Yzjk/10usOQ8QUaJ8Rg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 0518D339; Tue, 28 May 2024 04:43:18 -0700 (PDT) Received: from [10.1.36.57] (e133649.arm.com [10.1.36.57]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9F5593F762; Tue, 28 May 2024 04:42:50 -0700 (PDT) Message-ID: <0387ac04-2dbe-4a73-975a-078a18554654@arm.com> Date: Tue, 28 May 2024 12:42:48 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v3 5/6] sched/uclamp: Simplify uclamp_eff_value() To: Dietmar Eggemann , Ingo Molnar , Peter Zijlstra , Vincent Guittot , Juri Lelli , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider Cc: Qais Yousef , Morten Rasmussen , Lukasz Luba , Christian Loehle , pierre.gondois@arm.com, linux-kernel@vger.kernel.org References: <6209eda0b134ad7a0be8855ffdd7b4c747fb8048.1715082714.git.hongyan.xia2@arm.com> <1f8c50f2-6530-49bd-9b41-744437078100@arm.com> Content-Language: en-US From: Hongyan Xia In-Reply-To: <1f8c50f2-6530-49bd-9b41-744437078100@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 26/05/2024 23:52, Dietmar Eggemann wrote: > On 07/05/2024 14:50, Hongyan Xia wrote: > > [...] > >> +static inline unsigned long uclamp_eff_value(struct task_struct *p, >> + enum uclamp_id clamp_id) >> +{ >> + if (uclamp_is_used() && p->uclamp[clamp_id].active) >> + return p->uclamp[clamp_id].value; >> + >> + if (clamp_id == UCLAMP_MIN) >> + return 0; >> + >> + return SCHED_CAPACITY_SCALE; > > Why not keep using 'return uclamp_none(clamp_id)' here? Reason is that uclamp_none() is in core.c. I could move uclamp_none() into sched.h if needed.