summaryrefslogtreecommitdiff
path: root/src/shared/cpu-set-util.h
Commit message (Collapse)AuthorAgeFilesLines
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* core: introduce support for setting NUMAMask= to special "all" valueMichal Sekletár2020-09-081-0/+1
| | | | Fixes #14113
* shared: split out NUMA code from cpu-set-util.c to numa-util.cMichal Sekletár2020-03-161-27/+0
|
* core: introduce NUMAPolicy and NUMAMask optionsMichal Sekletar2019-06-241-0/+28
| | | | | | | | | | | | | Make possible to set NUMA allocation policy for manager. Manager's policy is by default inherited to all forked off processes. However, it is possible to override the policy on per-service basis. Currently we support, these policies: default, prefer, bind, interleave, local. See man 2 set_mempolicy for details on each policy. Overall NUMA policy actually consists of two parts. Policy itself and bitmask representing NUMA nodes where is policy effective. Node mask can be specified using related option, NUMAMask. Default mask can be overwritten on per-service level.
* shared/cpu-set-util: introduce cpu_set_to_range()Michal Sekletar2019-05-291-0/+2
|
* shared/cpu-set-util: make transfer of cpu_set_t over bus endian safeMichal Sekletar2019-05-291-0/+3
|
* shared/cpu-set-util: drop now-unused cleanup functionZbigniew Jędrzejewski-Szmek2019-05-291-3/+0
|
* test-execute: use CPUSet tooZbigniew Jędrzejewski-Szmek2019-05-291-2/+1
| | | | | | cpu_set_malloc() was the last user. It doesn't seem useful to keep it just to save the allocation of a few hundred bytes in a test, so it is dropped and a fixed maximum is allocated (1024 bytes).
* Move cpus_in_affinity_mask() to cpu-set-util.[ch]Zbigniew Jędrzejewski-Szmek2019-05-291-0/+2
| | | | | It just seems to fit better there and it's always better to have things in shared/ rather than basic/.
* Rework cpu affinity parsingZbigniew Jędrzejewski-Szmek2019-05-291-15/+32
| | | | | | | | | | | | | | | | | | The CPU_SET_S api is pretty bad. In particular, it has a parameter for the size of the array, but operations which take two (CPU_EQUAL_S) or even three arrays (CPU_{AND,OR,XOR}_S) still take just one size. This means that all arrays must be of the same size, or buffer overruns will occur. This is exactly what our code would do, if it received an array of unexpected size over the network. ("Unexpected" here means anything different from what cpu_set_malloc() detects as the "right" size.) Let's rework this, and store the size in bytes of the allocated storage area. The code will now parse any number up to 8191, independently of what the current kernel supports. This matches the kernel maximum setting for any architecture, to make things more portable. Fixes #12605.
* shared/cpu-set-util: remove now-unused CPU_SIZE_TO_NUM()Zbigniew Jędrzejewski-Szmek2019-05-211-6/+0
|
* shared/cpu-set-util: move the part to print cpu-set into a separate functionZbigniew Jędrzejewski-Szmek2019-05-211-0/+1
| | | | | Also avoid unnecessary asprintf() when we can write to the output area directly.
* Move various files that don't need to be in basic/ to shared/Zbigniew Jędrzejewski-Szmek2018-11-201-0/+35
This doesn't have much effect on the final build, because we link libbasic.a into libsystemd-shared.so, so in the end, all the object built from basic/ end up in libsystemd-shared. And when the static library is linked into binaries, any objects that are included in it but are not used are trimmed. Hence, the size of output artifacts doesn't change: $ du -sb /var/tmp/inst* 54181861 /var/tmp/inst1 (old) 54207441 /var/tmp/inst1s (old split-usr) 54182477 /var/tmp/inst2 (new) 54208041 /var/tmp/inst2s (new split-usr) (The negligible change in size is because libsystemd-shared.so is bigger by a few hundred bytes. I guess it's because symbols are named differently or something like that.) The effect is on the build process, in particular partial builds. This change effectively moves the requirements on some build steps toward the leaves of the dependency tree. Two effects: - when building items that do not depend on libsystemd-shared, we build less stuff for libbasic.a (which wouldn't be used anyway, so it's a net win). - when building items that do depend on libshared, we reduce libbasic.a as a synchronization point, possibly allowing better parallelism. Method: 1. copy list of .h files from src/basic/meson.build to /tmp/basic 2. $ for i in $(grep '.h$' /tmp/basic); do echo $i; git --no-pager grep "include \"$i\"" src/basic/ 'src/lib*' 'src/nss-*' 'src/journal/sd-journal.c' |grep -v "${i%.h}.c";echo ;done | less