From: Peter Zijlstra <peterz@infradead.org>
To: Yun Hsiang <hsiang023167@gmail.com>
Cc: dietmar.eggemann@arm.com, linux-kernel@vger.kernel.org,
qais.yousef@arm.com, patrick.bellasi@matbug.net,
kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v5 1/1] sched/uclamp: add SCHED_FLAG_UTIL_CLAMP_RESET flag to reset uclamp
Date: Tue, 10 Nov 2020 13:21:08 +0100 [thread overview]
Message-ID: <20201110122108.GG2594@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20201103023756.1012088-1-hsiang023167@gmail.com>
On Tue, Nov 03, 2020 at 10:37:56AM +0800, Yun Hsiang wrote:
> If the user wants to stop controlling uclamp and let the task inherit
> the value from the group, we need a method to reset.
>
> Add SCHED_FLAG_UTIL_CLAMP_RESET flag to allow the user to reset uclamp via
> sched_setattr syscall.
>
> The policy is
> _CLAMP_RESET => reset both min and max
> _CLAMP_RESET | _CLAMP_MIN => reset min value
> _CLAMP_RESET | _CLAMP_MAX => reset max value
> _CLAMP_RESET | _CLAMP_MIN | _CLAMP_MAX => reset both min and max
>
The obvious alternative would be to use a magic value in
sched_util_{min,max} to indicate reset. After all, we strictly enforce
the values are inside [0,1024], which leaves us with many unused values.
Specifically -1 comes to mind. It would allow doing this without an
extra flag, OTOH the explicit flag is well, more explicit.
I don't have a strong preference either way, but I wanted to make sure
it was considered, and perhaps we can record why this isn't as nice a
solution, dunno.
next prev parent reply other threads:[~2020-11-10 12:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-03 2:37 [PATCH v5 1/1] sched/uclamp: add SCHED_FLAG_UTIL_CLAMP_RESET flag to reset uclamp Yun Hsiang
2020-11-03 13:46 ` Qais Yousef
2020-11-03 13:48 ` Qais Yousef
2020-11-04 9:45 ` Dietmar Eggemann
2020-11-07 18:24 ` Yun Hsiang
2020-11-06 10:36 ` Patrick Bellasi
2020-11-07 19:15 ` Yun Hsiang
2020-11-09 13:41 ` Qais Yousef
2020-11-10 12:18 ` Peter Zijlstra
2020-11-10 12:21 ` Peter Zijlstra [this message]
2020-11-11 17:41 ` Dietmar Eggemann
2020-11-11 18:04 ` Peter Zijlstra
2020-11-12 5:44 ` Yun Hsiang
2020-11-12 13:05 ` Dietmar Eggemann
2020-11-12 14:41 ` Qais Yousef
2020-11-12 16:01 ` Dietmar Eggemann
2020-11-13 11:45 ` Dietmar Eggemann
2020-11-13 12:26 ` Qais Yousef
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201110122108.GG2594@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=dietmar.eggemann@arm.com \
--cc=hsiang023167@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=patrick.bellasi@matbug.net \
--cc=qais.yousef@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox