[Toybox] more general sched_setattr/sched_getattr command?

enh enh at google.com
Tue Dec 7 12:27:09 PST 2021

is there an existing general sched_setattr/sched_getattr command somewhere
that we can copy? we have chrt/nice/taskset for various subsets, and i
think that _between_ them they already cover everything that
sched_setattr(2) can do -- policy/reset-on-fork/nice/priority -- except for
5.3+'s "task utilization attributes", sched_util_min/sched_util_max? (see
for those, since they're not in the man7 man pages yet.)

i'm asking because there are Android folks who're using the
sched_util_min/sched_util_max stuff (that they seem to call "uclamp") who
would like a command-line interface (and currently have their own random
thing), but aren't able to point to any existing practice.

i'm wondering whether yet another special case makes sense, or we should
try to have a more generic "schedattr" command. and, even more
interestingly, whether there's any existing practice on other systems that
we should be looking at?

alternatively, although these new options don't seem like a *great* fit for
chrt, it would probably be doable to add them as something like
long-opt-only `--util-min X` and `--util-max X`? we could just make the
current "no PRIORITY" not an error if you supplied one/both of those?
(Android's current tool always takes both min and max, which is a bit
awkward as an option.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20211207/266dc40c/attachment.html>

More information about the Toybox mailing list