From fe2efa2e41c6d1162086e4703dedc3591282e54a Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Thu, 29 Feb 2024 16:44:04 +0900 Subject: [PATCH] Document UsageQueueLoader --- unified-scheduler-logic/src/lib.rs | 2 +- unified-scheduler-pool/src/lib.rs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/unified-scheduler-logic/src/lib.rs b/unified-scheduler-logic/src/lib.rs index a7a0b872d94e41..f5e6bf86ce9e15 100644 --- a/unified-scheduler-logic/src/lib.rs +++ b/unified-scheduler-logic/src/lib.rs @@ -682,7 +682,7 @@ impl SchedulingStateMachine { /// caller's responsibility to ensure the same instance is returned from the closure, given a /// particular pubkey. /// - /// Closure is used here to delegate the responsibility of general ownership of `UsageQueue` + /// Closure is used here to delegate the responsibility of primary ownership of `UsageQueue` /// (and caching/pruning if any) to the caller. `SchedulingStateMachine` guarantees that all of /// shared owndership of `UsageQueue`s are released and UsageQueue state is identical to just /// after created, if `has_no_active_task()` is `true`. Also note that this is desired for diff --git a/unified-scheduler-pool/src/lib.rs b/unified-scheduler-pool/src/lib.rs index ed4b354fbd8658..4eace6d7a93792 100644 --- a/unified-scheduler-pool/src/lib.rs +++ b/unified-scheduler-pool/src/lib.rs @@ -393,6 +393,12 @@ mod chained_channel { } } +/// The primary owner of all [`UsageQueue`]s used for particular [`PooledScheduler`]. +/// +/// Currently, the simplest implementation. This grows memory usage in unbounded way. Cleaning will +/// be added later. This struct is here to be put outside `solana-unified-scheduler-logic` for the +/// crate's original intent (separation of logics from this crate). Some practical and mundane +/// pruning will be implemented in this type. #[derive(Default, Debug)] pub struct UsageQueueLoader { usage_queues: DashMap,