Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp1744979lqb; Sun, 26 May 2024 15:53:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWRJahx5nDyyrEwBVAh2LFriB/yhEPohFx9OD5WLR/Krub3tvNljvFSojCpMy2f1Oa5RaUVi5nLutS+f4Y8EHuBryBdPHB/OShJp6EWbg== X-Google-Smtp-Source: AGHT+IGqrSC0qi0icM93DuNTl3fgtelApLFZtZuTZRIj/O4zw/CfwvR0aot7aQtxSUpm7n9sc8TE X-Received: by 2002:ac2:4e10:0:b0:51b:e0f0:e4f8 with SMTP id 2adb3069b0e04-52964bb0ea4mr6250948e87.31.1716763997055; Sun, 26 May 2024 15:53:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716763997; cv=pass; d=google.com; s=arc-20160816; b=LSrkFcgJl1HnaUH5KAJTYtgmtNatp6k5karrZU3eOsKNTQBym03lMruEgOrajS37Wp JNLyBQRGGBA0R8LB9vk2/GjXRgEmDiFzJED+rbFeylB+UtVc5/Wygl7uLiSa0bkHaeNr VfWeFV8Dvo2XfmT6xRmaHaP8WV4sdaz+gOA8A7u3Hi7Dzmy0u3YQ/oXvjeyMNUhw8K1m BFI4PvSTiXPursyVcKFXF8q6j5YR+eOVkdAV1mvp+MvPB2l/8BhaVGDRgyZihRFRj6z5 Tb7f+n6iwqTPxztakPB7aCGoTnxv3h9zYY61U4QCSkjrYiX0nJrR8UN3X0jQEuNFrQp4 14Vg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=3oa0dbEslaJyhh/MuWrvKPaSEcbefyXTrNcikWod+bc=; fh=Cquev1HCU8rRrvORsYLr7VaHkwJsZ83BErC89ct94hg=; b=fIZMsLGzJgXTnz0ZRoYMbwYFJKwZzCP5/up3HHiXWDcnn/wEWo8ZrVCv5N6/7L4a5A fvmslrsNOR1mdB0kGhAeIpv/YeUOU42+PdgHBgKqvWWvuzwcAlncsTfJjXuI8Z3saKHW 4fQmZI0WAOWP0Y+gqMuxVvdIEyZ14M63JcxsFHyV+5sx4i500IbxHESAygYhb9+goCJL MOMQRst6IKe9Ngm/3ezWuioj7dKA3KPGVhWB1F5pVp4ddWfruxIrJi/nNhSwX7bAhBB1 aDDf4REfJibbR2oo64R4vkAB8Zk6JrMA/Ndq0JZ+WA3Sq8/MzE3HWG8RtqpgIHYhUH4Q oRPw==; 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-189892-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189892-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5786258783asi2577001a12.426.2024.05.26.15.53.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 May 2024 15:53:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-189892-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-189892-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-189892-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 am.mirrors.kernel.org (Postfix) with ESMTPS id C3D7E1F21816 for ; Sun, 26 May 2024 22:53:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DFB0B13A248; Sun, 26 May 2024 22:53:00 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4BC62535A4 for ; Sun, 26 May 2024 22:52:58 +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=1716763980; cv=none; b=A+WuoxNKaGCnOXaTqZ16AcqlypFiEXNbBb/cD8Fjf9xygDChnT8PW5QUawOcL3SmdPjAChE+m9/rmZfxlUM4Ky0pSxiNs+tEmO0qQJeB2dRkvndYKh1fd/4q8LTUCXkXofFJbDMWUUTcKsPzB92dg8lBZl8EB3WMDG1Pu5OTSLA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716763980; c=relaxed/simple; bh=EngjvVv8BMOk2WNYMsum5bWofAIg4FVPRgU35cNhc2c=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pAMXuU5d7wmuzggwfM3VDuX+1kzKSr64kLotSHeBbTc3szjRyWkI4s+KoX3Gzm3JK/fi6IGl/N4QVSGpvALqBYtQbpQd3TzhNjCvrpf2Oq+mIJYwa982Vd59ROBFET5rKSqkKoHGAGF3mgkcjsVdnxFZp8JQgVZCwnMAalKU7hQ= 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 E2664339; Sun, 26 May 2024 15:53:21 -0700 (PDT) Received: from [192.168.178.6] (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7BEEB3F641; Sun, 26 May 2024 15:52:55 -0700 (PDT) Message-ID: <1f8c50f2-6530-49bd-9b41-744437078100@arm.com> Date: Mon, 27 May 2024 00:52:54 +0200 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: Hongyan Xia , 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> From: Dietmar Eggemann Content-Language: en-US In-Reply-To: <6209eda0b134ad7a0be8855ffdd7b4c747fb8048.1715082714.git.hongyan.xia2@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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? [...]