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

Change drcachesim default to core_serial for a much improved schedule #6949

Closed
derekbruening opened this issue Aug 28, 2024 · 0 comments · Fixed by #7042
Closed

Change drcachesim default to core_serial for a much improved schedule #6949

derekbruening opened this issue Aug 28, 2024 · 0 comments · Fixed by #7042

Comments

@derekbruening
Copy link
Contributor

Today the drcachesim default is still the old static round-robin assignment of threads to cores. We should change the default to be core_serial to use the scheduler. There are complexities preventing us from removing the old static schedule, though: if you want to run another tool at the same time that doesn't want core-sharded, it seems like we should still support that.

@derekbruening derekbruening self-assigned this Aug 28, 2024
derekbruening added a commit that referenced this issue Oct 15, 2024
Adds a new interface trace_analysis_tool::preferred_shard_type() to
the drmemtrace framework to allow tools to request core-sharded
operation.

The cache simulator, TLB simulator, and schedule_stats tools override
the new interface to request core-sharded mode.

Unfortunately, it is not easy to detect core-sharded-on-disk traces in
the launcher, so the user must now pass `-no_core_sharded` when using
such traces with core-sharded-preferring tools to avoid the trace
being re-scheduled yet again.  Documentation for this is added and it
is turned into a fatal error since this re-scheduling there is almost
certainly user error.

In the launcher, if all tools prefer core-sharded, and the user did
not specify -no_core_sharded, core-sharded (or core-serial) mode is
enabled, with a -verbose 1+ message.
```
  $ bin64/drrun -stderr_mask 0 -t drcachesim -indir ../src/clients/drcachesim/tests/drmemtrace.threadsig.x64.tracedir/ -verbose 1 -tool schedule_stats:cache_simulator
  Enabling -core_serial as all tools prefer it
  <...>
  Schedule stats tool results:
  Total counts:
             4 cores
             8 threads: 1257600, 1257602, 1257599, 1257603, 1257598, 1257604, 1257596, 1257601
        638938 instructions
  <...>
  Core #0 schedule: AEA_A_
  Core #1 schedule: BH_
  Core #2 schedule: CG
  Core #3 schedule: DF_
  <...>
  Cache simulation results:
  Core #0 (traced CPU(s): #0)
    L1I0 (size=32768, assoc=8, block=64, LRU) stats:
      Hits:                          123,659
  <...>
```

If at least one tool prefers core-sharded but others do not, a
-verbose 1+ message suggests running with an explicit -core_sharded.
```
  $ bin64/drrun -stderr_mask 0 -t drcachesim -indir ../src/clients/drcachesim/tests/drmemtrace.threadsig.x64.tracedir/ -verbose 1 -tool cache_simulator:basic_counts
  Some tool(s) prefer core-sharded: consider re-running with -core_sharded or -core_serial enabled for best results.
```

Reduces the scheduler queue diagnostics by 5x as they seem too
frequent in short runs.

Updates the documentation to mention the new defaults.

Updates numerous drcachesim test output templates.

Keeps a couple of tests using thread-sharded by passing -no_core_serial.

Fixes #6949
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant