Replace mark_(un)blocked with (un)park#155997
Replace mark_(un)blocked with (un)park#155997zetanumbers wants to merge 2 commits intorust-lang:mainfrom
mark_(un)blocked with (un)park#155997Conversation
|
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
|
r? @mu001999 rustbot has assigned @mu001999. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? @nnethercote |
|
Do I understand correctly that blocking no longer releases jobserver tokens? |
No, it does. Or am I missing something? |
|
Missed those calls. |
There was a problem hiding this comment.
Seems ok to me, though once again this is code I don't understand well.
@Zoxc: any thoughts before I approve?
| pub struct QueryWaiter<'tcx> { | ||
| pub parent: Option<QueryJobId>, | ||
| pub condvar: Condvar, | ||
| // FIXME: could be made u16 due to rustc_thread_pool limiting number of threads |
There was a problem hiding this comment.
I don't think shrinking this field will change the struct size because the other fields are all 64-bits (on 64-bit platforms). I suggest just removing the comment.
|
Let's check perf: @bors try @rust-timer queue |
|
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
|
⌛ Trying commit 0d8d68d with merge 03472e2… To cancel the try build, run the command Workflow: https://github.com/rust-lang/rust/actions/runs/25202610893 |
Replace `mark_(un)blocked` with `(un)park`
|
💥 Test timed out after |
|
It looks good to me. |
So here's the thing. We can store condvar within rustc_thread_pool and do all of bookkeeping stuff there. I thought about making a
QueryLatcha simpleAtomicU64of which each bit represents a waiting thread ordered by its worker thread index. It's not as simple as that in this PR, but by moving query waiter's condvar we are finally able to useArc::get_mutfor thecyclesmart pointer.