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

Introduce SchedulingStateMachine for unified scheduler #129

Merged
merged 54 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
649e49d
Introduce SchedulingStateMachine
ryoqun Feb 22, 2024
3da5193
Apply all typo fixes from code review
ryoqun Feb 24, 2024
241793d
Update word wrapping
ryoqun Feb 24, 2024
87d70ec
Clarify Token::assume_exclusive_mutating_thread()
ryoqun Feb 24, 2024
5653573
Use slice instead of &Vec<_>
ryoqun Feb 24, 2024
cb3b7e7
Improve non-const explanation
ryoqun Feb 25, 2024
062737f
Document consecutive readonly rescheduling opt.
ryoqun Feb 25, 2024
f714c7c
Make test_gradual_locking terminate for miri
ryoqun Feb 25, 2024
67ec735
Avoid unnecessary Task::clone()
ryoqun Feb 26, 2024
4ad26ce
Rename: lock_{status,result} and no attempt_...()
ryoqun Feb 26, 2024
0150399
Add safety comment for get_account_locks_unchecked
ryoqun Feb 28, 2024
0e93b8d
Reduce and comment about Page::blocked_tasks cap.
ryoqun Feb 28, 2024
7e32187
Document SchedulingStateMachine::schedule_task()
ryoqun Feb 28, 2024
5ee9dbf
Add justification of closure in create_task
ryoqun Feb 28, 2024
d1d4afe
Use the From trait for PageUsage
ryoqun Feb 28, 2024
aeb126a
Replace unneeded if-let with .expect()
ryoqun Feb 29, 2024
0dd1cc0
Add helpful comments for peculiar crossbeam usage
ryoqun Feb 29, 2024
92fc13d
Fix typo
ryoqun Feb 29, 2024
c926fce
Make bug-bounty-exempt statement more clear
ryoqun Feb 29, 2024
a341686
Add test_enfoced_get_account_locks_verification
ryoqun Feb 29, 2024
f424608
Fix typos...
ryoqun Feb 29, 2024
97734bd
Big rename: Page => UsageQueue
ryoqun Feb 29, 2024
e045f3f
Document UsageQueueLoader
ryoqun Feb 29, 2024
3109988
Various minor cleanings for beautifier diff
ryoqun Feb 29, 2024
5a896b6
Ensure reinitialize() is maintained for new fields
ryoqun Mar 1, 2024
2e57c23
Remove uneeded impl Send for TokenCell & doc upd.
ryoqun Mar 7, 2024
056c23d
Apply typo fixes from code review
ryoqun Mar 7, 2024
939348b
Merge similar tests into one
ryoqun Mar 7, 2024
c3ea936
Remove test_debug
ryoqun Mar 7, 2024
9f45b27
Remove assertions of task_index()
ryoqun Mar 7, 2024
9eed18b
Fix UB in TokenCell
ryoqun Mar 18, 2024
91adf7e
Make schedule_task doc comment simpler
ryoqun Mar 18, 2024
de43ea3
Document deschedule_task
ryoqun Mar 18, 2024
1fce313
Simplify unlock_usage_queue() args
ryoqun Mar 18, 2024
e2515b0
Add comment for try_unblock() -> None
ryoqun Mar 18, 2024
97f3978
Switch to Option<Usage> for fewer assert!s
ryoqun Mar 18, 2024
00233f3
Add assert_matches!() to UsageQueue methods
ryoqun Mar 19, 2024
98689eb
Add panicking test case for ::reinitialize()
ryoqun Mar 19, 2024
4230f58
Use UsageFromTask
ryoqun Mar 19, 2024
789ad63
Rename: LockAttempt => LockContext
ryoqun Mar 19, 2024
d08aa99
Move locking and unlocking methods to usage queue
ryoqun Mar 19, 2024
fc743a6
Remove outdated comment...
ryoqun Mar 19, 2024
9f5cac1
Remove redundant fn: pop_unblocked_usage_from_task
ryoqun Mar 19, 2024
7696a47
Document the index of task
ryoqun Mar 19, 2024
a485017
Clarifty comment a bit
ryoqun Mar 19, 2024
da966ef
Update .current_usage inside try_lock()
ryoqun Mar 19, 2024
771ad21
Use inspect_err to simplify code
ryoqun Mar 19, 2024
9f9f9ff
fix ci...
ryoqun Mar 19, 2024
b80b2fd
Use ()...
ryoqun Mar 19, 2024
dce9809
Rename: schedule{,_next}_unblocked_task()
ryoqun Mar 22, 2024
2d86ed1
Rename: {try_lock,unlock}_{for_task,usage_queues}
ryoqun Mar 22, 2024
50ddb5c
Test solana-unified-scheduler-logic under miri
ryoqun Apr 2, 2024
f681fde
Test UB to illustrate limitation of TokenCell
ryoqun Apr 4, 2024
ffa1857
Test UB of using multiple tokens at the same time
ryoqun Apr 4, 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 Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion ci/test-miri.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@

set -eo pipefail

source ci/_
source ci/rust-version.sh nightly

# miri is very slow; so only run very few of selective tests!
cargo "+${rust_nightly}" miri test -p solana-program -- hash:: account_info::
_ cargo "+${rust_nightly}" miri test -p solana-program -- hash:: account_info::

_ cargo "+${rust_nightly}" miri test -p solana-unified-scheduler-logic

# run intentionally-#[ignored] ub triggering tests for each to make sure they fail
(! _ cargo "+${rust_nightly}" miri test -p solana-unified-scheduler-logic -- \
--ignored --exact "utils::tests::test_ub_illegally_created_multiple_tokens")
(! _ cargo "+${rust_nightly}" miri test -p solana-unified-scheduler-logic -- \
--ignored --exact "utils::tests::test_ub_illegally_shared_token_cell")
3 changes: 3 additions & 0 deletions programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3562,6 +3562,9 @@ impl Bank {
transaction: &'a SanitizedTransaction,
) -> TransactionBatch<'_, '_> {
let tx_account_lock_limit = self.get_transaction_account_lock_limit();
// Note that switching this to .get_account_locks_unchecked() is unacceptable currently.
// The unified scheduler relies on the checks enforced here.
// See a comment in SchedulingStateMachine::create_task().
let lock_result = transaction
.get_account_locks(tx_account_lock_limit)
.map(|_| ());
Expand Down
2 changes: 2 additions & 0 deletions unified-scheduler-logic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ license = { workspace = true }
edition = { workspace = true }

[dependencies]
assert_matches = { workspace = true }
solana-sdk = { workspace = true }
static_assertions = { workspace = true }
1,394 changes: 1,387 additions & 7 deletions unified-scheduler-logic/src/lib.rs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions unified-scheduler-pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ edition = { workspace = true }
[dependencies]
assert_matches = { workspace = true }
crossbeam-channel = { workspace = true }
dashmap = { workspace = true }
derivative = { workspace = true }
log = { workspace = true }
solana-ledger = { workspace = true }
Expand Down
Loading
Loading