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

Move PROFQ_CHAN to a Session field #48691

Merged
merged 1 commit into from
Mar 11, 2018
Merged

Move PROFQ_CHAN to a Session field #48691

merged 1 commit into from
Mar 11, 2018

Conversation

Zoxc
Copy link
Contributor

@Zoxc Zoxc commented Mar 3, 2018

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 3, 2018
PROFQ_CHAN.set(&sess.profile_channel, || {
compile_input_impl(trans, sess, cstore, input_path, input, outdir, output, addl_plugins, control)
})
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this is the point were the Rayon thread pool is created in my branch. This is split out to its own function to avoid rightward drift (and merge conflicts).

@Zoxc
Copy link
Contributor Author

Zoxc commented Mar 3, 2018

@alexcrichton Can you release a version of scoped-tls with the visibility modifier so we don't have to link to a github repo?

@Zoxc Zoxc force-pushed the profq-chan branch 2 times, most recently from 46233b6 to 019b9a8 Compare March 3, 2018 07:14
@alexcrichton
Copy link
Member

Sure! It's now published

@michaelwoerister
Copy link
Member

Would it be possible to move this into TyCtxt::create_and_enter(), maybe even make the sender a local variable there instead of a field of Session?

@Zoxc
Copy link
Contributor Author

Zoxc commented Mar 5, 2018

@alexcrichton I get this error if I try to use 0.1.1:

error: failed to select a version for `scoped-tls`
all possible versions conflict with previously selected versions of `scoped-tls`
required by package `cargo v0.26.0 (file:///B:/dev/rust/par-merge/src/tools/cargo)`
    ... which is depended on by `rls v0.126.0 (file:///B:/dev/rust/par-merge/src/tools/rls)`
  previously selected package `scoped-tls v0.1.1`
    ... which is depended on by `rustc v0.0.0 (file:///B:/dev/rust/par-merge/src/librustc)`
    ... which is depended on by `rustc_trans v0.0.0 (file:///B:/dev/rust/par-merge/src/librustc_trans)`
  possible versions to select: 0.1.0
failed to run: B:\dev\rust\par-merge\build\x86_64-pc-windows-msvc\stage0\bin\cargo.exe build --manifest-path B:\dev\rust\par-merge\src/bootstrap/Cargo.toml

@michaelwoerister It is used when no TyCtxt exists. I also prefer globals to be part of the Session struct instead of hiding in thread local storage. I should check if it's feasible to pass &Session to profq_msg and get rid of PROFQ_CHAN.

@alexcrichton
Copy link
Member

@Zoxc sounds like rust-lang/cargo#4127

@michaelwoerister
Copy link
Member

I should check if it's feasible to pass &Session to profq_msg and get rid of PROFQ_CHAN.

That sounds good too.

@Zoxc
Copy link
Contributor Author

Zoxc commented Mar 6, 2018

profq_msg is used for time, which is used in LLVM workers which doesn't have access to Session. That should be fixable by passing Option<&Session> to time. It's also used in with_task_impl which also doesn't have Session access, but providing that there shouldn't be too hard.

@michaelwoerister
Copy link
Member

Do what you have to :)

I think this query profiling infrastructure is in dire need of a refactoring.

@Zoxc Zoxc changed the title Make PROFQ_CHAN a scoped thread local Move PROFQ_CHAN to a Session field Mar 6, 2018
@Zoxc Zoxc force-pushed the profq-chan branch 3 times, most recently from 23307ee to 7d3aaf9 Compare March 6, 2018 11:56
@Zoxc
Copy link
Contributor Author

Zoxc commented Mar 6, 2018

I removed PROFQ_CHAN. Now there's even more changes for you to review.

@michaelwoerister
Copy link
Member

Looks good to me. Thank you, @Zoxc! r=me once travis passes.

@bors
Copy link
Contributor

bors commented Mar 6, 2018

☔ The latest upstream changes (presumably #48611) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 6, 2018
@Zoxc
Copy link
Contributor Author

Zoxc commented Mar 7, 2018

@bors r=michaelwoerister

@bors
Copy link
Contributor

bors commented Mar 7, 2018

📌 Commit 97b23a0 has been approved by michaelwoerister

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 7, 2018
@bors
Copy link
Contributor

bors commented Mar 8, 2018

☔ The latest upstream changes (presumably #46882) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 8, 2018
@Zoxc
Copy link
Contributor Author

Zoxc commented Mar 9, 2018

@bors r=michaelwoerister

@bors
Copy link
Contributor

bors commented Mar 9, 2018

📌 Commit 4ab6367 has been approved by michaelwoerister

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 9, 2018
@bors
Copy link
Contributor

bors commented Mar 9, 2018

☔ The latest upstream changes (presumably #48860) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 9, 2018
@Zoxc
Copy link
Contributor Author

Zoxc commented Mar 9, 2018

@bors r=michaelwoerister

@bors
Copy link
Contributor

bors commented Mar 9, 2018

📌 Commit 184fd32 has been approved by michaelwoerister

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 9, 2018
@bors
Copy link
Contributor

bors commented Mar 9, 2018

⌛ Testing commit 184fd32 with merge c4b30439801c581bcc4da232971bc79d22893e8e...

@bors
Copy link
Contributor

bors commented Mar 9, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 9, 2018
@kennytm
Copy link
Member

kennytm commented Mar 9, 2018

@bors retry #48866

@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 Mar 9, 2018
@bors
Copy link
Contributor

bors commented Mar 11, 2018

⌛ Testing commit 184fd32 with merge ae379bd...

bors added a commit that referenced this pull request Mar 11, 2018
@bors
Copy link
Contributor

bors commented Mar 11, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: michaelwoerister
Pushing ae379bd to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants