File tree Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9
- refs/heads/incoming: e55c5ceac239417784f9fe8c37f92e974b9cc06e
9
+ refs/heads/incoming: 5ba7434cb17c19438b00730b37741f2d61449ad8
10
10
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
12
12
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -248,6 +248,13 @@ MUST_CHECK bool rust_task::yield() {
248
248
249
249
// This check is largely superfluous; it's the one after the context swap
250
250
// that really matters. This one allows us to assert a useful invariant.
251
+
252
+ // NB: This takes lifecycle_lock three times, and I believe that none of
253
+ // them are actually necessary, as per #3213. Removing the locks here may
254
+ // cause *harmless* races with a killer... but I didn't observe any
255
+ // substantial performance improvement from removing them, even with
256
+ // msgsend-ring-pipes, and also it's my last day, so I'm not about to
257
+ // remove them. -- bblum
251
258
if (must_fail_from_being_killed ()) {
252
259
{
253
260
scoped_lock with (lifecycle_lock);
Original file line number Diff line number Diff line change @@ -431,12 +431,11 @@ rust_task::call_on_rust_stack(void *args, void *fn_ptr) {
431
431
assert (get_sp_limit () != 0 && " Stack must be configured" );
432
432
assert (next_rust_sp);
433
433
434
- bool had_reentered_rust_stack;
435
- {
436
- scoped_lock with (lifecycle_lock);
437
- had_reentered_rust_stack = reentered_rust_stack;
438
- reentered_rust_stack = true ;
439
- }
434
+ // Unlocked access. Might "race" a killer, but harmlessly. This code is
435
+ // only run by the task itself, so cannot race itself. See the comment
436
+ // above inhibit_kill (or #3213) in rust_task.cpp for justification.
437
+ bool had_reentered_rust_stack = reentered_rust_stack;
438
+ reentered_rust_stack = true ;
440
439
441
440
uintptr_t prev_c_sp = next_c_sp;
442
441
next_c_sp = get_sp ();
@@ -448,10 +447,7 @@ rust_task::call_on_rust_stack(void *args, void *fn_ptr) {
448
447
__morestack (args, fn_ptr, sp);
449
448
450
449
next_c_sp = prev_c_sp;
451
- {
452
- scoped_lock with (lifecycle_lock);
453
- reentered_rust_stack = had_reentered_rust_stack;
454
- }
450
+ reentered_rust_stack = had_reentered_rust_stack;
455
451
456
452
record_sp_limit (0 );
457
453
}
You can’t perform that action at this time.
0 commit comments