Commit Graph

2881 Commits

Author SHA1 Message Date
Arthur Paulino 6a67807fd0 Implement `IdSet::iter_in`
This patch enables more expressive ways to slice and iterate over
the `Id`s in an `IdSet` with `IdSet::iter_in`, which takes an arbitrary
`IdSetSlicer`.

`IdSet::iter_in` efficiently slices out unintended inner parts and
then, within the remaining parts, skips inactive bits by using
`BitSlice::iter_ones` from the `bitvec` crate.

It also delivers several implementations of `IdSetSlicer` so OSTD
consumers can represent `Id` ranges ergonomically.

In the Asterinas kernel, `CpuSet::iter_in` enables a cleaner way to
define an interator that cycles over the CPUs.
2025-10-25 11:23:13 +08:00
Arthur Paulino 01d9b61337 Enhanced per-CPU load stats
This patch creates a `PerCpuLoadStats` with slightly enhanced, enough
to serve load stats and the load-balancing algorithm. This struct can
be further enhanced for more elaborated load-balancing algorithms in
the future.

The load stats report has been fixed, as `SchedulerStats::nr_queued_and_running`
no longer includes idle threads in the queued total nor in the running
threads.

Furthemore, the load-balancing algorithm has been improved because it
no longer accounts with the idle threads when they're enqueued.
2025-10-25 10:38:59 +08:00
jiangjianfeng fe39a6803d Unshare VM during execve 2025-10-25 10:36:30 +08:00
jiangjianfeng caeec3cdc1 Unshare signal handler during execve 2025-10-25 10:36:30 +08:00
jiangjianfeng 207bfe30e2 Support multithreaded execve 2025-10-25 10:36:30 +08:00
jiangjianfeng f49f62890e Add test for multi-threaded execve 2025-10-25 10:36:30 +08:00
Zejun Zhao 8251d48bf2 Add RISC-V PLIC support 2025-10-24 16:28:41 +08:00
Zejun Zhao 752f040368 Implement security-sensitive IoMem 2025-10-24 16:28:41 +08:00
Zejun Zhao 68721b2365 Activate kernel page table earlier on BSP 2025-10-24 16:28:41 +08:00
Zejun Zhao 72dbaa4b38 Use absolute time when setting up timer interrupt using SBI 2025-10-24 11:32:28 +08:00
Chen Chengjun a9dfc98c63 Add tests for mount bind 2025-10-24 11:13:09 +08:00
Chen Chengjun 0a80d55c95 Support mount bind a file 2025-10-24 11:13:09 +08:00
Chen Chengjun 53a1268e19 Add mountinfo files to proc filesystem 2025-10-24 11:12:16 +08:00
Chen Chengjun 7b68571290 Support generating the mount infomation 2025-10-24 11:12:16 +08:00
Tao Su 79d737c268 Support arrays with multiple element types in SCML 2025-10-22 20:30:30 +08:00
Tao Su cff91123bb Add inline struct patterns in SCML 2025-10-22 20:30:30 +08:00
Tate, Hongliang Tian c44e45ea78 Add the `IdSet<I>` utility type 2025-10-22 14:29:52 +08:00
Tate, Hongliang Tian d9a74c6cfc Remove unit tests that instantiate invalid CpuId 2025-10-22 14:29:52 +08:00
Tate, Hongliang Tian 6942bc6643 Extract CpuId into a sub-module of the `cpu` module
This prevents creating invalid instances of `CpuId` within the `cpu`
module by using `CpuId(raw_id)` directly. Another benefit is to
make the `cpu` module more modular, which is good for readability
and maintainability.
2025-10-22 14:29:52 +08:00
Ruihan Li 7e7ba43cdf Revise some error messages 2025-10-22 14:05:38 +08:00
Ruihan Li 9ac0e31981 Implement better FS path APIs 2025-10-22 14:05:38 +08:00
Chen Chengjun 857424de52 Test the case where pidfd is negative in the test 2025-10-20 21:07:28 +08:00
Chen Chengjun a22935f4c6 Correct the errno of waitid when the input pidfd is negative 2025-10-20 21:07:28 +08:00
Ruihan Li 8be8397a67 Make network callbacks and names related 2025-10-20 20:56:55 +08:00
Ruihan Li 582812ac92 Reorder `new_loopback` and `new_virtio` 2025-10-20 20:56:55 +08:00
Ruihan Li 74f23ce23d Fix some `kill`-related behavior 2025-10-20 14:05:45 +08:00
Ruihan Li 75edabc557 Construct `SignalSenderIds` from `Context` 2025-10-20 14:05:45 +08:00
Ruihan Li 43f50c5e2a Fix futex return values 2025-10-20 11:24:48 +08:00
Ruihan Li 52ddbeaff8 Use the `Arc<Waker>` address as the futex ID 2025-10-20 11:24:48 +08:00
Ruihan Li 34b4ad5e9b Clean up visibility in `futex.rs` 2025-10-20 11:24:48 +08:00
Yuke Peng 23f14df21f [sched] Fix the missing of preemption check in RISC-V & loongarch 2025-10-20 11:17:24 +08:00
jiangjianfeng 600446e9e1 Cleanup ThreadName related code 2025-10-20 10:52:07 +08:00
Tate, Hongliang Tian a7e45201e7 Update README.md for ICSE 2026 paper acceptance 2025-10-18 17:58:52 +08:00
Chen Chengjun 782301c239 Remove open-related APIs from FsResolver 2025-10-17 16:18:56 +08:00
Chen Chengjun c2ab393d57 Cleanup the lookup APIs of FsResolver 2025-10-17 16:18:56 +08:00
Ruihan Li 384e5bc70d Fix an off-by-one bug in the trap frame 2025-10-16 22:28:29 +09:00
Ruihan Li fe7dc1f83e Adjust some symbol names 2025-10-16 22:28:29 +09:00
Ruihan Li 3673049620 Resolve minor issues in `ostd::src::arch` 2025-10-16 21:46:40 +09:00
Ruihan Li bc6ef5231b Reorangize `ostd::arch::irq` 2025-10-16 21:46:40 +09:00
Wang Siyuan f69d39e9c1 Add a regression test for `/proc/[pid]/mem` 2025-10-15 16:34:32 +08:00
Wang Siyuan 3f2c319e00 Support `/proc/[pid]/mem` and `/proc/[pid]/task/[tid]/mem` 2025-10-15 16:34:32 +08:00
Wang Siyuan ef5e0060d7 Support reading `InitStack` across pages 2025-10-15 16:34:32 +08:00
Wang Siyuan c2adcf9944 Support accessing user spaces of other processes 2025-10-15 16:34:32 +08:00
Qingsong Chen 257b0c63b1 Fix ext2 block groups count 2025-10-14 13:20:06 +09:00
Tao Su f97479edff Add `wait4` and `clone` syscall limitation to the book 2025-10-14 13:17:42 +09:00
Ruihan Li 0be36ee2c1 Fix virtio-mmio interrupt handling 2025-10-14 00:48:09 +09:00
Tao Su d8bc04dbbe Add networking & sockets related syscall limitations to the book 2025-10-14 00:44:48 +09:00
Ruihan Li 51eb74250e Fix several MMIO/PIO allocation bugs 2025-10-14 00:22:38 +09:00
Ruihan Li 7d86d326a3 Adjust the MMIO area alignment 2025-10-14 00:22:38 +09:00
Ruihan Li fa59b8be2b Adjust visibility marks in `ostd::io` 2025-10-14 00:22:38 +09:00