Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp220471pxx; Thu, 29 Oct 2020 00:25:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaddWUOtCyKoOsrVt0Z28cGFWT3VlJ6ieeh6GwkAZEY+5z2EVEmxuBiyNOW3lk5DNfRT6G X-Received: by 2002:a50:85c6:: with SMTP id q6mr2715841edh.126.1603956306826; Thu, 29 Oct 2020 00:25:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603956306; cv=none; d=google.com; s=arc-20160816; b=DWPOcYon2KbaG2rM8UPHYFSnIFXvB/k69CCdzVbiOgNY/qkbxH2mU09pdK/IYiS74i DL2nGuydZE3I8aDO0A1pcbMab5Btd+IRlxyp8c/C9K5xHB78Wtebdh78fbSPQjvD8nXG BEwG7m7bnKBRZOnpUehzlGiI/zlWtW5GGzWrjdV4AsI+ETzGUhQJ52sZ5vaoqMjKsLiK IlaEl6QL8W3KIPV+qWl6YyI7U+Io9YaO7/veSHa3mh+E/ibg0pBRZHP+3UtiOzORzn0y f8HXYkHc3+B2bOWUucIPkBHwFdHGa1E15vJ/+Gvfy0c3Na/WgOVMs85/q+6KKhkfaKF8 hKeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=AJsxn0FPcWjc0/c3vz6zPFQV43GCUSenM9SaEyeNGL0=; b=S/tqUfeNg61D6cy7UuKiOuALxmvGbQpzOH1O46XN8loHMLeFhGvYsk1hRGqNyXZmcS krg3Xj9beRjp22/l3EQrrQmG8gvDmc2sFStqve3NaOkn9+WWssP0Qnb4j0Njn9J7MeYS e3Nm15TUK5ge+dHhgcysF9rF2n+iafdg3zoOLHf9HVq6fAPgd9/3WuveStdhgOhKVd9K LbiPrhDtyugcgq1NPVV5kjb2av2IbvVSfXmhgyn3alGkxsUKKgdE0h7X3lUN9Gp6nCIx IL7CfNLEtEgsOF5OsID2UI0Zddbu5awJkKapRkWpeRgCssMFdTi/NpQrSow3kdLgvPcl AEcA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w1si1291694edf.49.2020.10.29.00.24.45; Thu, 29 Oct 2020 00:25:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731491AbgJ1WRQ (ORCPT + 99 others); Wed, 28 Oct 2020 18:17:16 -0400 Received: from foss.arm.com ([217.140.110.172]:39542 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731482AbgJ1WRP (ORCPT ); Wed, 28 Oct 2020 18:17:15 -0400 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 2207C175D; Wed, 28 Oct 2020 04:39:47 -0700 (PDT) Received: from e107158-lin (e107158-lin.cambridge.arm.com [10.1.194.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 558AE3F719; Wed, 28 Oct 2020 04:39:46 -0700 (PDT) Date: Wed, 28 Oct 2020 11:39:43 +0000 From: Qais Yousef To: Patrick Bellasi Cc: Yun Hsiang , Dietmar Eggemann , peterz@infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/1] sched/uclamp: add SCHED_FLAG_UTIL_CLAMP_RESET flag to reset uclamp Message-ID: <20201028113943.7jzxbytizrv7wsm3@e107158-lin> References: <20201025073632.720393-1-hsiang023167@gmail.com> <08b7cdda-291c-bdf1-b72d-0a3ef411fcf3@arm.com> <20201026154538.GA807103@ubuntu> <605c21f7-3c4d-5c24-6d23-9f2604e6757b@arm.com> <20201027155813.GA818508@ubuntu> <87v9eumzic.derkling@matbug.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87v9eumzic.derkling@matbug.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/28/20 11:11, Patrick Bellasi wrote: > >> > >> /* > >> * RT by default have a 100% boost value that could be modified > >> * at runtime. > >> */ > >> if (unlikely(rt_task(p) && clamp_id == UCLAMP_MIN)) > >> - __uclamp_update_util_min_rt_default(p); > >> + value = sysctl_sched_uclamp_util_min_rt_default; > > By removing this usage of __uclamp_updadate_util_min_rt_default(p), > the only other usage remaining is the call from: > uclamp_udpate_util_min_rt_default(). > > What about an additional cleanup by in-lining the only surviving usage? This is not a cleanup IMO. There is special rule about updating that are encoded and documented in this helper function. Namely: * p->pi_lock must be held. * p->uclamp_req[].user_defined must be false. I don't see open coding helps but rather makes the code harder to read and prone to introduce bugs if anything gets reshuffled in the future. Thanks -- Qais Yousef