mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-21 16:33:24 +00:00
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:
committed by
Tate, Hongliang Tian
parent
efd49a96e3
commit
4701eaf0cb
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user