Hi Pádraig,

Pádraig Brady <p...@draigbrady.com> writes:

> cgroup constraints are a popular mechanism on linux.
> I was thinking of augmenting the nproc routines
> to incorporate cgroup cpu constraints for NPROC_CURRENT_OVERRIDABLE
> so that we'd return MIN(cgroup constraint, current value);
>
> The cgroup constraint would be inferred from:
>   cat $(findmnt -n -t cgroup2 -o target)/$(cut -d: -f3- < 
> /proc/self/cgroup)/cpu.max
> though the C will be a bit more involved of course :)
>
> I'll look at doing this soon, unless there are other opinions.

Thanks for bringing it up here. Just wanted to link the GitHub bug
report in Coreutils that most likely prompted this [1].

I thought about implementing it as well, but didn't get around to it.
I'm thinking it is best to add the logic behind another value for
'enum nproc_query' in lib/nproc.h.

Collin

[1] https://github.com/coreutils/coreutils/issues/108

Reply via email to