Implementation of load average calculation and corresponding /proc entry

Moved everything into the kernel side. Add a SchedulerStats trait

Use 'fixed' to represent fixed-point numbers

Make the loadavg calculation lazy
This commit is contained in:
Champii1
2024-10-18 18:46:58 +02:00
committed by Tate, Hongliang Tian
parent efd49a96e3
commit 4701eaf0cb
12 changed files with 256 additions and 3 deletions

View File

@ -305,3 +305,8 @@ static POSIX_TID_ALLOCATOR: AtomicU32 = AtomicU32::new(1);
pub fn allocate_posix_tid() -> Tid {
POSIX_TID_ALLOCATOR.fetch_add(1, Ordering::SeqCst)
}
/// Returns the last allocated tid
pub fn last_tid() -> Tid {
POSIX_TID_ALLOCATOR.load(Ordering::SeqCst) - 1
}