rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.63k stars 12.74k forks source link

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

Closed brson closed 10 years ago

brson commented 12 years ago

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.

brson commented 12 years ago

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 commented 12 years ago

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

bstrie commented 11 years ago

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

emberian commented 11 years ago

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

catamorphism commented 11 years ago

Low priority, not 1.0

brson commented 10 years ago

@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 commented 10 years ago

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