-
Notifications
You must be signed in to change notification settings - Fork 271
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
Apply misc small cleanups to unified scheduler #4080
Apply misc small cleanups to unified scheduler #4080
Conversation
pub fn working_bank_with_scheduler(&self) -> BankWithScheduler { | ||
self.banks[&self.highest_slot()].clone_with_scheduler() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it turned out returning all call sites ended up calling .clone_with_scheduler() immediately after this. so, just do it inside here.
also, this makes it consistent the cousin (BankForks::working_bank
), which isn't returning refs as well.
@@ -782,7 +781,7 @@ impl<S: SpawnableScheduler<TH>, TH: TaskHandler> ThreadManager<S, TH> { | |||
session_result_receiver, | |||
session_result_with_timings: None, | |||
scheduler_thread: None, | |||
handler_threads: Vec::with_capacity(handler_count), | |||
handler_threads: vec![], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handler_threads
is reassigned in start_threads
, so no need to reserve capacity. also, this isn't perf sensitive code.
(task, &finished_blocked_task_sender) | ||
} else { | ||
continue; | ||
move || { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just indent stuff
@@ -551,7 +551,7 @@ mod chained_channel { | |||
|
|||
pub(super) fn send_chained_channel( | |||
&mut self, | |||
context: C, | |||
context: &C, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
taking ref here will soon be desired in upcoming pr...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
difference here is only that context
is not dropped at the end of this function.
@@ -1441,7 +1442,7 @@ impl<TH: TaskHandler> InstalledScheduler for PooledScheduler<TH> { | |||
|
|||
impl<S, TH> UninstalledScheduler for PooledSchedulerInner<S, TH> | |||
where | |||
S: SpawnableScheduler<TH, Inner = PooledSchedulerInner<S, TH>>, | |||
S: SpawnableScheduler<TH, Inner = Self>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see 2 line above... ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Problem
because I have some diff aesthetics, i need some preparation for #3946
Summary of Changes
See individual hunks for explanations
extracted from #3946, see the pr for the general overview.