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

Apply misc small cleanups to unified scheduler #4080

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

ryoqun
Copy link
Member

@ryoqun ryoqun commented Dec 12, 2024

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.

Comment on lines +287 to +288
pub fn working_bank_with_scheduler(&self) -> BankWithScheduler {
self.banks[&self.highest_slot()].clone_with_scheduler()
Copy link
Member Author

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![],
Copy link
Member Author

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 || {
Copy link
Member Author

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,
Copy link
Member Author

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...

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.

@ryoqun ryoqun marked this pull request as ready for review December 12, 2024 15:31
@ryoqun ryoqun requested a review from apfitzge December 12, 2024 15:31
@@ -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>,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see 2 line above... ;)

Copy link

@apfitzge apfitzge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ryoqun ryoqun added the automerge automerge Merge this Pull Request automatically once CI passes label Dec 12, 2024
@mergify mergify bot merged commit 6abf4f2 into anza-xyz:master Dec 12, 2024
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants