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

i#6938 sched migrate: Separate run queue per output #6985

Merged
merged 19 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
5eb838b
i#6938 sched migrate: All options in microseconds + single scale
derekbruening Sep 11, 2024
bdec908
Fix Windows build warning
derekbruening Sep 12, 2024
b12e991
Merge branch 'master' of github.com:DynamoRIO/dynamorio into i6938-ti…
derekbruening Sep 12, 2024
4b40d2b
Fix another Windows build warning
derekbruening Sep 12, 2024
33b5bfd
Fix yet another Windows build warning
derekbruening Sep 12, 2024
a462db1
Add missing includes
derekbruening Sep 12, 2024
c9ce27c
i#6938 sched migrate: Separate run queue per output
derekbruening Sep 6, 2024
5d6762a
Fix Windows build warnings; relax switches per core expected in test …
derekbruening Sep 13, 2024
0cb3cad
Fix another Windows build warning
derekbruening Sep 13, 2024
7cf2e42
Fix scaling bugs for blocked time and quantum; shift defaults to matc…
derekbruening Sep 13, 2024
3b3089d
Fix two unit tests missing time_units_per_us
derekbruening Sep 13, 2024
1d36d81
Remove diagnostics
derekbruening Sep 13, 2024
6dce7ce
Fix mis-attribution of stats on switchto to target's old output
derekbruening Sep 14, 2024
7e9fe13
On _SCHEDULE, give up target input lock before acquiring target outpu…
derekbruening Sep 14, 2024
6f37460
Give up direct switch input lock before acquiring its output lock
derekbruening Sep 16, 2024
2ebda7c
Review requests: s/runqueue/ready_queue/; add many comments; remove r…
derekbruening Sep 17, 2024
6128656
Merge branch 'master' of github.com:DynamoRIO/dynamorio into i6938-pe…
derekbruening Sep 17, 2024
a475ef4
Drop rebalance threshold from 1.5M to 150K as 1.5M is too high with t…
derekbruening Sep 17, 2024
baf9cf8
Review suggestion: optimize work-stealing loop
derekbruening Sep 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions clients/drcachesim/analyzer_multi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,9 @@ analyzer_multi_tmpl_t<RecordType, ReaderType>::init_dynamic_schedule()
sched_ops.blocking_switch_threshold = op_sched_blocking_switch_us.get_value();
sched_ops.block_time_multiplier = op_sched_block_scale.get_value();
sched_ops.block_time_max_us = op_sched_block_max_us.get_value();
sched_ops.migration_threshold_us = op_sched_migration_threshold_us.get_value();
sched_ops.rebalance_period_us = op_sched_rebalance_period_us.get_value();
sched_ops.time_units_per_us = op_sched_time_units_per_us.get_value();
sched_ops.randomize_next_input = op_sched_randomize.get_value();
sched_ops.honor_direct_switches = !op_sched_disable_direct_switches.get_value();
#ifdef HAS_ZIP
Expand Down
9 changes: 9 additions & 0 deletions clients/drcachesim/common/memtrace_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ class memtrace_stream_t {
* i.e., the number of input migrations to this core.
*/
SCHED_STAT_MIGRATIONS,
/**
* Counts the number of times this output's runqueue became empty and it took
* work from another output's runqueue.
*/
SCHED_STAT_RUNQUEUE_STEALS,
/**
* Counts the number of output runqueue rebalances triggered by this output.
*/
SCHED_STAT_RUNQUEUE_REBALANCES,
/** Count of statistic types. */
SCHED_STAT_TYPE_COUNT,
};
Expand Down
12 changes: 12 additions & 0 deletions clients/drcachesim/common/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,18 @@ droption_t<double> op_sched_time_units_per_us(
"of the -sched_*_us values as it converts wall-clock time into the simulated "
"microseconds measured by those options.");

droption_t<uint64_t> op_sched_migration_threshold_us(
DROPTION_SCOPE_ALL, "sched_migration_threshold_us", 500,
"Time in simulated microseconds before an input can be migrated across cores",
"The minimum time in simulated microseconds that must have elapsed since an input "
"last ran on a core before it can be migrated to another core.");

droption_t<uint64_t> op_sched_rebalance_period_us(
DROPTION_SCOPE_ALL, "sched_rebalance_period_us", 1500000,
"Period in microseconds at which core run queues are load-balanced",
"The period in simulated microseconds at which per-core run queues are re-balanced "
"to redistribute load.");

// Schedule_stats options.
droption_t<uint64_t>
op_schedule_stats_print_every(DROPTION_SCOPE_ALL, "schedule_stats_print_every",
Expand Down
3 changes: 3 additions & 0 deletions clients/drcachesim/common/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ extern dynamorio::droption::droption_t<std::string> op_cpu_schedule_file;
extern dynamorio::droption::droption_t<std::string> op_sched_switch_file;
extern dynamorio::droption::droption_t<bool> op_sched_randomize;
extern dynamorio::droption::droption_t<bool> op_sched_disable_direct_switches;
extern dynamorio::droption::droption_t<uint64_t> op_sched_migration_threshold_us;
extern dynamorio::droption::droption_t<uint64_t> op_sched_rebalance_period_us;
extern dynamorio::droption::droption_t<double> op_sched_time_units_per_us;
extern dynamorio::droption::droption_t<uint64_t> op_schedule_stats_print_every;
extern dynamorio::droption::droption_t<std::string> op_syscall_template_file;
extern dynamorio::droption::droption_t<uint64_t> op_filter_stop_timestamp;
Expand Down
9 changes: 9 additions & 0 deletions clients/drcachesim/scheduler/flexible_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ class flexible_queue_t {
return entries_[rand_gen_() % size()]; // Undefined if empty.
}

// Returns an entry from the back -- or at least not from the front; it's not
// guaranteed to be the lowest priority, just not the highest.
T
back()
{
assert(!empty());
return entries_.back();
}

bool
empty() const
{
Expand Down
881 changes: 651 additions & 230 deletions clients/drcachesim/scheduler/scheduler.cpp

Large diffs are not rendered by default.

273 changes: 180 additions & 93 deletions clients/drcachesim/scheduler/scheduler.h

Large diffs are not rendered by default.

337 changes: 251 additions & 86 deletions clients/drcachesim/tests/scheduler_unit_tests.cpp

Large diffs are not rendered by default.

Loading