Commit Graph

21 Commits

Author SHA1 Message Date
mergify[bot] b57b883355
v2.0: Fix BankForks::new_rw_arc memory leak (backport of #1893) (#2066)
* Fix BankForks::new_rw_arc memory leak (#1893)

(cherry picked from commit d441c0f577)

* Fix flaky test test_banking_stage_entries_only_central_scheduler (#2082)

---------

Co-authored-by: Andrei Silviu Dragnea <andreisilviudragnea@gmail.com>
Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
2024-07-17 16:11:40 -07:00
mergify[bot] a0934f5d15
v2.0: Avoid unneeded start_session() with cleanups (bp: #1815, #1861) (#1854)
* Avoid unneeded start_session() when spawning (#1815)

* Avoid unneeded start_session() when spawning

* Add comments

(cherry picked from commit 40a9851c82)

* Apply cosmetic changes to unified scheduler (#1861)

* Apply cosmetic changes to unified scheduler

* Use first instead of old-fashioned firstly

Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>

---------

Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>

---------

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
2024-06-28 12:19:04 +09:00
mergify[bot] b463b9255c
v2.0: Make unified scheduler opt-in for block verification (backport of #1668) (#1874)
Make unified scheduler opt-in for block verification (#1668)

* Enable unified scheduler for block verification

* Revert making unified scheduler enabled by default

(cherry picked from commit 40508cd03f)

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
2024-06-27 16:59:05 +09:00
Ryo Onodera 114d94a25e
Improve SchedulerStatus code and test as follow-up (#1797)
* Improve SchedulerStatus code and test as follow-up

* Don't use wait_timeout_while with magic number
2024-06-21 23:21:32 +09:00
Ryo Onodera d9fcfeb12a
Don't panic when pausing stale unified schedulers (#1761) 2024-06-18 11:44:16 +09:00
Ryo Onodera 334221503c
Return back stale out-of-pool scheduler by timeout (#1690)
* Return back stale out-of-pool scheduler by timeout

* Add tests

* Document and proper panic messages

* Avoid recursion

* Tweak comments
2024-06-13 12:48:49 +09:00
Ryo Onodera 56d1572203
Trash overgrown schedulers with many usage queues (#1672)
* Trash overgrown schedulers with many usage queues

* Fix a typo and improve comment wording
2024-06-11 14:28:13 +09:00
Ryo Onodera 10e814efae
Notify panics in handlers to the scheduler thread promptly (#1574)
* Gracefully abort scheduler on a panic in handlers

* Move test-related mention out of the tested code itself
2024-06-10 16:17:21 +09:00
Ryo Onodera a054e47953
Clean idle pooled schedulers periodically (#1575)
* Clean idle pooled schedulers periodically

* Fix race in failure_{with,without}_extra_tx

* Improve test

* Use extract_if polyfill

* Write justfication of extract_if with minor opt.
2024-06-10 16:05:10 +09:00
Joe C 31334c44eb
Vote: hoist vote sender types up to runtime (#1623)
vote: hoist vote sender types up to runtime
2024-06-06 10:59:48 -05:00
Ryo Onodera 74dcd3b0ad
Make unified schedler abort on tx execution errors (#1211)
* Make unified schedler abort on tx execution errors

* Fix typo and improve wording

* Indicate panic _should_ be enforced by trait impls

* Fix typo

* Avoid closure of closure...

* Rename: is_threads_joined => are_threads_joined

* Add some comments for trashed_scheduler_inners

* Ensure 100% coverage of end_session by more tests

* Document relation of aborted thread and is_trashed

* Replace sleep()s with sleepless_testing

* Fix lints from newer rust
2024-05-31 16:13:41 +09:00
Ryo Onodera e227d25c3a
Fine-tune unified scheduler loops by select_biased (#1437) 2024-05-22 13:01:11 +09:00
tom f868aa3809
fix typos (#1302) 2024-05-11 13:43:21 -06:00
Ryo Onodera f291ca4da1
Simplify {session_,}result_with_timings types (#1126)
* Simplify {session_,}result_with_timings types

* Add anoter minor cleanup...
2024-05-03 10:31:28 +09:00
Ryo Onodera 8e331e16cb
Fix scheduler deadlock by waiting at DropBankSrvc (#947)
* Fix scheduler deadlock by waiting at DropBankSrvc

* fix ci...

* Add comments and clean-up the test

* Remove explicit type from drop()

* Move test_scheduler_waited_by_drop_bank_service

* Fix ci..
2024-04-25 09:07:39 +09:00
Ryo Onodera fb465b3788
Prioritize blocked task messaging over idle tasks (#627)
* Prioritize blocked task messaging over idle tasks

* Add test_scheduler_schedule_execution_blocked

* Add commentary

* Reword commentary a bit

* Document not-chosen approach in detail

* Use {crossbeam,chained}_channel::unbounded()

* Add test for race condition around SchedulingContext

* Fix race condition around SchedulingContext

* Comment about finished channels

* Clean up the scheduling context race test

* Codify hidden assumption with extra 1 recv/session
  (EDIT there's actually no extra recv)
2024-04-18 13:15:25 +09:00
Ryo Onodera 0b9c6379b3
Introduce SchedulingStateMachine for unified scheduler (#129)
* Introduce SchedulingStateMachine

* Apply all typo fixes from code review

Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>

* Update word wrapping

* Clarify Token::assume_exclusive_mutating_thread()

* Use slice instead of &Vec<_>

* Improve non-const explanation

* Document consecutive readonly rescheduling opt.

* Make test_gradual_locking terminate for miri

* Avoid unnecessary Task::clone()

* Rename: lock_{status,result} and no attempt_...()

* Add safety comment for get_account_locks_unchecked

* Reduce and comment about Page::blocked_tasks cap.

* Document SchedulingStateMachine::schedule_task()

* Add justification of closure in create_task

* Use the From trait for PageUsage

* Replace unneeded if-let with .expect()

* Add helpful comments for peculiar crossbeam usage

* Fix typo

* Make bug-bounty-exempt statement more clear

* Add test_enfoced_get_account_locks_verification

* Fix typos...

* Big rename: Page => UsageQueue

* Document UsageQueueLoader

* Various minor cleanings for beautifier diff

* Ensure reinitialize() is maintained for new fields

* Remove uneeded impl Send for TokenCell & doc upd.

* Apply typo fixes from code review

Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>

* Merge similar tests into one

* Remove test_debug

* Remove assertions of task_index()

* Fix UB in TokenCell

* Make schedule_task doc comment simpler

* Document deschedule_task

* Simplify unlock_usage_queue() args

* Add comment for try_unblock() -> None

* Switch to Option<Usage> for fewer assert!s

* Add assert_matches!() to UsageQueue methods

* Add panicking test case for ::reinitialize()

* Use UsageFromTask

* Rename: LockAttempt => LockContext

* Move locking and unlocking methods to usage queue

* Remove outdated comment...

* Remove redundant fn: pop_unblocked_usage_from_task

* Document the index of task

* Clarifty comment a bit

* Update .current_usage inside try_lock()

* Use inspect_err to simplify code

* fix ci...

* Use ()...

* Rename: schedule{,_next}_unblocked_task()

* Rename: {try_lock,unlock}_{for_task,usage_queues}

* Test solana-unified-scheduler-logic under miri

* Test UB to illustrate limitation of TokenCell

* Test UB of using multiple tokens at the same time

---------

Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
2024-04-05 08:58:33 +09:00
Pankaj Garg cc3afa5588
Remove public visibility of program cache from bank (#279) 2024-03-17 15:29:20 -07:00
Ryo Onodera 024d6ecc4f
Add --unified-scheduler-handler-threads (#35195)
* Add --unified-scheduler-handler-threads

* Adjust value name

* Warn if the flag was ignored

* Tweak message a bit
2024-02-22 09:05:17 +09:00
Ryo Onodera bd103865df
Introduce primitive threading in unified scheduler (#34676)
* Introduce primitive threading in unified scheduler

* Make the internal struct ExecutedTask not pub

* Improve wording a bit

* Explain scheduler main loop's overhead sensitivity

* Improve wording a bit

* Define ChainedChannel{Sender, Receiver} wrappers

* Clean up a bit

* Use derivative to avoid manual Clone impl

* Clarify comment

* Remove extra whitespace in comment

* Remove unneeded dyn trait for ChainedChannel

* Remove the accumulator thread for now

* Fix typo

* Use unimplemented!() to convey intention better
2024-01-24 12:46:16 +09:00
Ryo Onodera d2b5afc410
Finish unified scheduler plumbing with min impl (#34300)
* Finalize unified scheduler plumbing with min impl

* Fix comment

* Rename leftover type name...

* Make logging text less ambiguous

* Make PhantomData simplyer without already used S

* Make TaskHandler stateless again

* Introduce HandlerContext to simplify TaskHandler

* Add comment for coexistence of Pool::{new,new_dyn}

* Fix grammar

* Remove confusing const for upcoming changes

* Demote InstalledScheduler::context() into dcou

* Delay drop of context up to return_to_pool()-ing

* Revert "Demote InstalledScheduler::context() into dcou"

This reverts commit 049a126c905df0ba8ad975c5cb1007ae90a21050.

* Revert "Delay drop of context up to return_to_pool()-ing"

This reverts commit 60b1bd2511a714690b0b2331e49bc3d0c72e3475.

* Make context handling really type-safe

* Update comment

* Fix grammar...

* Refine type aliases for boxed traits

* Swap the tuple order for readability & semantics

* Simplify PooledScheduler::result_with_timings type

* Restore .in_sequence()

* Use where for aesthetics

* Simplify if...

* Fix typo...

* Polish ::schedule_execution() a bit

* Fix rebase conflicts..

* Make test more readable

* Fix test failures after rebase...
2023-12-19 09:50:41 +09:00