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 migrate: Fix observed_migrations assert in schedule_stats #7059

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Changes from all commits
Commits
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
14 changes: 6 additions & 8 deletions clients/drcachesim/tools/schedule_stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,15 +498,13 @@ schedule_stats_t::aggregate_results(counters_t &total)
assert(shard.second->counters.direct_switches ==
shard.second->stream->get_schedule_statistic(
memtrace_stream_t::SCHED_STAT_DIRECT_SWITCH_SUCCESSES));
// If the scheduler is counting migrations, it may see more due to inputs
// not yet executed moving among runqueues.
#ifndef NDEBUG
double sched_migrations = shard.second->stream->get_schedule_statistic(
memtrace_stream_t::SCHED_STAT_MIGRATIONS);
#endif
assert(sched_migrations == 0. ||
sched_migrations >= shard.second->counters.observed_migrations);
}
// Our observed_migrations are counted on the destination core, while
// the scheduler reports migrations away from a source core: so we only
// check the aggregate. For non-dynamic schedules the scheduler-reported
// will be 0; otherwise, the scheduler may see more migrations due to inputs
// not yet executed moving among runqueues.
assert(total.migrations == 0. || total.migrations >= total.observed_migrations);
}

bool
Expand Down
Loading