rust/library
The 8472 bac5523ea0 Use cgroup quotas for calculating available_parallelism
Manually tested via


```
// spawn a new cgroup scope for the current user
$ sudo systemd-run -p CPUQuota="300%" --uid=$(id -u) -tdS


// quota.rs
#![feature(available_parallelism)]
fn main() {
    println!("{:?}", std:🧵:available_parallelism()); // prints Ok(3)
}
```


Caveats

* cgroup v1 is ignored
* funky mountpoints (containing spaces, newlines or control chars) for cgroupfs will not be handled correctly since that would require unescaping /proc/self/mountinfo
  The escaping behavior of procfs seems to be undocumented. systemd and docker default to `/sys/fs/cgroup` so it should be fine for most systems.
* quota will be ignored when `sched_getaffinity` doesn't work
* assumes procfs is mounted under `/proc` and cgroupfs mounted and readable somewhere in the directory tree
2022-03-03 00:43:45 +01:00
..
alloc Rollup merge of #92399 - Veeupup:fix_vec_typo, r=Dylan-DPC 2022-02-28 20:05:13 +01:00
backtrace@b02ed04a7e
core Temporarily make CStr not a link in the c_char docs 2022-03-01 17:36:40 -08:00
panic_abort Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00
panic_unwind library/panic_unwind: Define UNWIND_DATA_REG for m68k 2022-02-12 20:19:06 +00:00
portable-simd Rollup merge of #94452 - workingjubilee:sync-simd-bitmasks, r=workingjubilee 2022-03-01 03:41:53 +01:00
proc_macro Auto merge of #92598 - Badel2:panic-update-hook, r=yaahc 2022-01-16 02:18:42 +00:00
profiler_builtins Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00
rtstartup
rustc-std-workspace-alloc Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00
rustc-std-workspace-core Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00
rustc-std-workspace-std Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00
std Use cgroup quotas for calculating available_parallelism 2022-03-03 00:43:45 +01:00
stdarch@b4a0e07552 Fix documentation for is_X_feature_detected! 2022-02-17 18:17:15 +00:00
test Switch bootstrap cfgs 2022-02-25 08:00:52 -05:00
unwind library/unwind: Define unwinder_private_data_size for m68k 2022-02-12 20:21:10 +00:00