lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201110122108.GG2594@hirez.programming.kicks-ass.net>
Date:   Tue, 10 Nov 2020 13:21:08 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Yun Hsiang <hsiang023167@...il.com>
Cc:     dietmar.eggemann@....com, linux-kernel@...r.kernel.org,
        qais.yousef@....com, patrick.bellasi@...bug.net,
        kernel test robot <lkp@...el.com>
Subject: Re: [PATCH v5 1/1] sched/uclamp: add SCHED_FLAG_UTIL_CLAMP_RESET
 flag to reset uclamp

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ