Rollup of 4 pull requests#151521
Conversation
…anieu std: use `clock_nanosleep` for `sleep` where available `nanosleep` is specified to use `CLOCK_REALTIME` but the documentation (especially the example) for `sleep` imply that it measures time using `Instant`, which uses `CLOCK_MONOTONIC`. Thus, this PR makes `sleep` use a relative `clock_nanosleep` with `CLOCK_MONOTONIC` where available. This doesn't make a difference for Linux (which uses `CLOCK_MONOTONIC` for `nanosleep` anyway) but is relevant for e.g. FreeBSD. This also restores nanosecond-sleep precision for WASI, since rust-lang#150290 was caused by `nanosleep` internally using `clock_nanosleep` with `CLOCK_REALTIME` which is unsupported on WASIp2. CC @alexcrichton for the WASI fix
… r=jhpratt std: ensure that the deadline has passed in `sleep_until` The clock source used for `sleep` might not be the same as the one used for `Instant`, so the implementation of `sleep_until` may not assume that the `Instant` has elapsed. This is particularly relevant on Windows, where [`QueryPerformanceCounter`](https://learn.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter) is used for `Instant`, but [`SetWaitableTimer`](https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-setwaitabletimer) is (probably[^1]) based on [`QueryUnbiasedInterruptTimePrecise`](https://learn.microsoft.com/en-us/windows/win32/api/realtimeapiset/nf-realtimeapiset-queryunbiasedinterrupttimeprecise). If these clocks drift apart, the `sleep` might return before the deadline has passed. Thus, this PR makes `sleep_until` recheck the current time after waking up and restart the `sleep` if necessary. [^1]: The documentation doesn't specify a clock, but `QueryUnbiasedInterruptTimePrecise` uses the same units and doesn't count time during sleep either, so I'd wager it's what is used for the timer.
global.rs: improve readability of re-entrance section
Reorganizing tests/ui/issues 11 tests [3/N] part of rust-lang#133895 r? Kivooeo
|
@bors r+ rollup=never p=4 |
This comment has been minimized.
This comment has been minimized.
|
📌 Perf builds for each rolled up PR:
previous master: d10ac47c20 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing d10ac47 (parent) -> 1655912 (this PR) Test differencesShow 44 test diffsStage 1
Stage 2
Additionally, 2 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 165591238e723f2e4a1adecb0b4bacebb805bb6f --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (1655912): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (secondary 5.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 14.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 473.42s -> 472.43s (-0.21%) |
Successful merges:
clock_nanosleepforsleepwhere available #151450 (std: useclock_nanosleepforsleepwhere available)sleep_until#151494 (std: ensure that the deadline has passed insleep_until)r? @ghost
Create a similar rollup