Skip to content

feature request: Cpus_allowed #53

@LXYan2333

Description

@LXYan2333

Dear maintainer:

I read this line:

// Cpus_allowed[_list] will be added upon request.

Honestly speaking, I really do not want to parse this line by myself. On my laptop, it outputs:

$ cat /proc/self/status
……
Cpus_allowed:   ff
Cpus_allowed_list:      0-7
……

but on a server with 40 cores, it outputs:

$ cat /proc/self/status
……
Cpus_allowed:   ff,ffffffff
Cpus_allowed_list:      0-39
……

I guess parse it is bug prone. The document about it is very brief:

Cpus_allowed
        Hexadecimal mask of CPUs on which this process may
        run (since Linux 2.6.24, see [cpuset(7)](https://man7.org/linux/man-pages/man7/cpuset.7.html)).

Cpus_allowed_list
        Same as previous, but in "list format" (since Linux
        2.6.26, see [cpuset(7)](https://man7.org/linux/man-pages/man7/cpuset.7.html)).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions