Closed
Bug 1479250
Opened 7 years ago
Closed 6 years ago
Style threads are allocated with eagerly committed stacks on Windows
Categories
(Core :: CSS Parsing and Computation, enhancement, P3)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
People
(Reporter: kmag, Assigned: xidorn)
References
(Blocks 2 open bugs)
Details
(Whiteboard: [overhead:1.5M])
This also applies to other Rust threads, but Stylo threads are the biggest chunk of that.
All of the non-Rust threads we create on Windows use the STACK_SIZE_PARAM_IS_A_RESERVATION flag, which causes us to reserve stack space, but not commit it until it's used. std::thread doesn't do that, which means that all of the thread stack space is eagerly committed, and immediately consumes resources.
With 6 Stylo threads at 256KiB each, that's 1.5MiB per process.
Assignee | ||
Comment 1•7 years ago
|
||
Would this become irrelevant if we can fix bug 1475091?
Comment 2•7 years ago
|
||
(In reply to Kris Maglione [:kmag] from comment #0)
> This also applies to other Rust threads, but Stylo threads are the biggest
> chunk of that.
>
> All of the non-Rust threads we create on Windows use the
> STACK_SIZE_PARAM_IS_A_RESERVATION flag, which causes us to reserve stack
> space, but not commit it until it's used. std::thread doesn't do that, which
> means that all of the thread stack space is eagerly committed, and
> immediately consumes resources.
>
> With 6 Stylo threads at 256KiB each, that's 1.5MiB per process.
Do you think just modifying libstd to pass the flag by default is feasible / desirable? Or should we try to add an API to configure it the same way as thread names can be configured?
Flags: needinfo?(kmaglione+bmo)
Reporter | ||
Comment 3•7 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #2)
> Do you think just modifying libstd to pass the flag by default is feasible /
> desirable? Or should we try to add an API to configure it the same way as
> thread names can be configured?
I think having libstd pass the flag by default probably makes the most sense. That would make the behavior on Windows match other platforms, and is pretty standard practice for threading libraries on Windows anyway.
Flags: needinfo?(kmaglione+bmo)
Assignee | ||
Comment 4•7 years ago
|
||
Discussed with emilio on IRC, I'm going to send a patch to Rust to fix this.
Assignee: nobody → xidorn+moz
Assignee | ||
Comment 5•7 years ago
|
||
Submitted rust-lang/rust#52847 for the change.
Assignee | ||
Comment 6•7 years ago
|
||
The Rust PR has been merged, should be in 1.30.
Updated•7 years ago
|
Priority: -- → P3
Updated•6 years ago
|
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•