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

Store the task pointer on the Rust stack segment, not in TLS #1804

Closed
brson opened this issue Feb 10, 2012 · 7 comments
Closed

Store the task pointer on the Rust stack segment, not in TLS #1804

brson opened this issue Feb 10, 2012 · 7 comments
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows I-slow Issue: Problems and improvements with respect to performance of generated code. P-low Low priority

Comments

@brson
Copy link
Contributor

brson commented Feb 10, 2012

We should be able to get the task pointer faster by storing it on the current stack segment instead of looking it up in TLS.

@ghost ghost assigned brson Feb 10, 2012
@brson
Copy link
Contributor Author

brson commented Feb 16, 2012

The current situation with upcall_call_shim_on_c_stack turning off the stack boundary (#1226) makes this optimization much less useful than it could be (basically, it will work for upcalls, but builtins will pay a penalty for failing to find the stack boundary).

@brson
Copy link
Contributor Author

brson commented Feb 16, 2012

So my first attempt at this resulted in a 2s regression, possibly because of the above issue.

@bstrie
Copy link
Contributor

bstrie commented Jul 2, 2013

@brson, is this still relevant with the new scheduler work?

@emberian
Copy link
Member

@brson given that growable etc stacks are changing/gone, is this issue still relevant at all?

@catamorphism
Copy link
Contributor

Low priority, not 1.0

@brson
Copy link
Contributor Author

brson commented Jan 16, 2014

@cmr it is. It would still be faster than using TLS generally to do this. I no longer think this is the right way to do it since it would be very vulnerable to stack smashing attacks. Instead I'd rather just commandeer another TCB slot for the task pointer.

@brson
Copy link
Contributor Author

brson commented Apr 17, 2014

With #[thread_local] I think there is likely very little perf left to be gained here, if any. This bug is obsolete.

@brson brson closed this as completed Apr 17, 2014
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
* update rust toolchain to nightly 1.66.0-nightly

* move to code block instead of escaping

* fix missing quote

* disable clippy check: clippy::uninlined-format-args

Co-authored-by: rahulku <luhark@a07817b4397e.ant.amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows I-slow Issue: Problems and improvements with respect to performance of generated code. P-low Low priority
Projects
None yet
Development

No branches or pull requests

4 participants