Closed
Bug 1382844
Opened 8 years ago
Closed 7 years ago
IonCompile has different behavior under rr
Categories
(Core :: JavaScript Engine: JIT, enhancement, P5)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
INVALID
People
(Reporter: tcampbell, Assigned: tcampbell)
References
Details
Attachments
(1 file)
|
2.03 KB,
patch
|
nbp
:
review+
|
Details | Diff | Splinter Review |
Currently rr emulates sysconf(_SC_NPROCESSORS_ONLN) as indicating 1 CPU. This causes Ion to use compile with different heuristics making to hard to capture traces of real-world behavior.
I'm running in to this because the bytecode limits for IonCompile and Ion inlining are very different between single-core and multi-core mode.
I'd like to add an ion option to override the js::GetCPUCount() values used to make heuristic decisions to allow captures on rr.
| Assignee | ||
Comment 1•8 years ago
|
||
js::SetFakeCPUCount() already exists but it is only available under jsshell. Allowing an environment variable in full browser would probably be cleanest way to do this.
| Assignee | ||
Comment 2•8 years ago
|
||
Add JS_FAKECPUCOUNT environment variable to initialize GlobalHelperThreadState().
Also fix the one case js where we use GetCPUCount() directly instead of HelperThreadState().
Attachment #8889640 -
Flags: review?(nicolas.b.pierron)
| Assignee | ||
Updated•8 years ago
|
Assignee: nobody → tcampbell
Comment 3•8 years ago
|
||
Comment on attachment 8889640 [details] [diff] [review]
0001-Bug-1382844-Add-JS_FAKECPUCOUNT-environment-variable.patch
Review of attachment 8889640 [details] [diff] [review]:
-----------------------------------------------------------------
Enabling chaos mode in rr (record -h) randomize the number of cores between 1 to 8.
Thus, if this patch is needed for cases where the chaos mode is not desirable, r=me with the following nit fixed and open an issue against rr to add a command line option for that.
Otherwise close this bug.
::: js/src/vm/HelperThreads.cpp
@@ +866,5 @@
> + if (const char* env = getenv("JS_FAKECPUCOUNT")) {
> + char * str_end;
> + long fakeCpuCount = strtol(env, &str_end, 10);
> + if (fakeCpuCount > 0 && fakeCpuCount < 10000 && (*str_end == '\0'))
> + cpuCount = fakeCpuCount;
nit: 9999 cores, really? I know some computers might have larger numbers of cores, but does it matter much yet? What about:
if (*env > '0' && *env <= '9')
cpuCount = env[0] - '0';
Attachment #8889640 -
Flags: review?(nicolas.b.pierron) → review+
| Assignee | ||
Comment 4•8 years ago
|
||
I'm not sure if I still want to land this. Will have to revisit when I next need to deal with rr and jit behavior.
Priority: -- → P5
| Assignee | ||
Updated•7 years ago
|
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•