Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 5 pull requests #131288

Merged
merged 35 commits into from
Oct 5, 2024
Merged

Rollup of 5 pull requests #131288

merged 35 commits into from
Oct 5, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

tiif and others added 30 commits October 1, 2024 03:00
Refactor ``return_read_bytes_and_count`` and ``return_written_byte_count_or_error``

Fixes rust-lang#3904

This PR
- separate the error logic from ``return_read_bytes_and_count`` and ``return_written_byte_count_or_error`` into a helper function ``set_last_error_and_return``.
Make returning io errors more uniform and convenient
This PR replaces the `LazyBox` wrapper used to allocate the pthread primitives with `OnceBox`, which has a more familiar API mirroring that of `OnceLock`. This cleans up the code in preparation for larger changes like rust-lang#128184 (from which this PR was split) and allows some neat optimizations, like avoid an acquire-load of the allocation pointer in `Mutex::unlock`, where the initialization of the allocation must have already been observed.

Additionally, I've gotten rid of the TEEOS `Condvar` code, it's just a duplicate of the pthread one anyway and I didn't want to repeat myself.
This test demonstrates the need to synchronize the clock
of the thread waking up from an epoll_wait from the thread
that issued the epoll awake event.
A couple of instructions were left over from an earlier rebase
it would seem. They don't impact the logic but the ready_list type
is about to change in the next commit.

Rather than modify one of these lines in the commit that changes
ready_list, only to have these lines removed later on, remove them now.
They don't impact the tests results.
This adds a VClock to the epoll implementation's ready_list
and has this VClock synced from the thread that updates
an event in the ready_list and then has the VClocks of any
threads being made runnable again, out of the calls to
epoll_wait, synced from it.
A simplification that doesn't impact the epoll implementation's logic.

It is not necessary to clone the ready_list before reading its
`is_empty` state.

This avoids the clone step but more importantly avoids the invisible
drop step of the clone.
…li-obk

Add vector clock to epoll ready lists

Replaces rust-lang#3928

Fixes rust-lang#3911
Implement LLVM x86 gfni intrinsics
…lfJung

pthread mutex: better error in reentrant-locking-UB

Also test reentrant locking of PTHREAD_MUTEX_INITIALIZER
Prefer refutable slice patterns over len check + index op

Just something I noticed while reviewing other PRs

We do it for shim arguments almost everywhere, but when the size is not statically known, we didn't use the helpers as they rely on array ops. But we can avoid a len check followed by several index ops by just using a refutable slice pattern with `let else`.

The pattern is so common, it seems almost worth a dedicated macro
…lit-at-mut, r=RalfJung

Stabilize `const_slice_split_at_mut` and `const_slice_first_last_chunk`

Stabilizes rust-lang#101804 and the remainder of rust-lang#111774.

FCP proposed in the tracking issue.

Requires rust-lang#130403 (or it would need a rustc_allow_const_fn_unstable for it)

Stabilized const API:
```rust
// slice
impl [T] {
    pub const fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]);
    pub const fn split_at_mut_unchecked(&mut self, mid: usize) -> (&mut [T], &mut [T]);
    pub const fn split_at_mut_checked(&mut self, mid: usize) -> Option<(&mut [T], &mut [T])>;

    pub const fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>;
    pub const fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>;
    pub const fn split_first_chunk_mut<const N: usize>(&mut self) -> Option<(&mut [T; N], &mut [T])>;
    pub const fn split_last_chunk_mut<const N: usize>(&mut self) -> Option<(&mut [T; N], &mut [T])>;
}
```

Closes rust-lang#101804
Closes rust-lang#111774

cc `@RalfJung`
std: replace `LazyBox` with `OnceBox`

This PR replaces the `LazyBox` wrapper used to allocate the pthread primitives with `OnceBox`, which has a more familiar API mirroring that of `OnceLock`. This cleans up the code in preparation for larger changes like rust-lang#128184 (from which this PR was split) and allows some neat optimizations, like avoid an acquire-load of the allocation pointer in `Mutex::unlock`, where the initialization of the allocation must have already been observed.

Additionally, I've gotten rid of the TEEOS `Condvar` code, it's just a duplicate of the pthread one anyway and I didn't want to repeat myself.
…mdev

move f16/f128 const fn under f16/f128 feature gate

The `*_const` features were added to work around rust-lang#129656, which should not be needed any more.
…Kobzol

remove outdated contribution direction
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Oct 5, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Oct 5, 2024

📌 Commit 72acacf has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 5, 2024
@bors
Copy link
Contributor

bors commented Oct 5, 2024

⌛ Testing commit 72acacf with merge f559d61...

@bors
Copy link
Contributor

bors commented Oct 5, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing f559d61 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 5, 2024
@bors bors merged commit f559d61 into rust-lang:master Oct 5, 2024
7 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Oct 5, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#130428 Stabilize const_slice_split_at_mut and `const_slice_first… df832ae1095b969929f4fde2882479306c69c4d7 (link)
#131094 std: replace LazyBox with OnceBox 812b19478dccf8ee1d969d9c7cf7bdecab3c6597 (link)
#131256 move f16/f128 const fn under f16/f128 feature gate 2ed7f9f2d19c8cdbc03299a19dc0b40c2d59b4b0 (link)
#131278 remove outdated contribution direction b362eabc6123fbba2464bc39812d135a7f287c66 (link)
#131286 Miri subtree update 784fb5b133ef34afec5d06ed5a72d3c4caf698b0 (link)

previous master: 5a4ee43c38

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f559d61): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (secondary -3.2%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.2% [-4.0%, -2.1%] 3
All ❌✅ (primary) - - 0

Cycles

Results (secondary -2.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.1% [-2.2%, -2.0%] 4
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 774.178s -> 773.78s (-0.05%)
Artifact size: 342.23 MiB -> 342.21 MiB (-0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.