vasilito
ae03a7e60b
kernel: Linux-compatible /proc/[pid]/stat format
...
Implements proper /proc/[pid]/stat output matching Linux fs/proc/array.c format:
- utime/stime: separate user/kernel CPU time accounting in context switch
- pgrp/session/start_time: process group, session, boot-time start
- proc_rss(): Resident Set Size from page table grant walker
- num_threads: thread-group counting via owner_proc_id filter
- nice: derived from priority (prio/2 - 20)
- proc_stat_line(): proper 52-field /proc/[pid]/stat format
- proc_status_text(): VmSize/VmRSS in kB
Infrastructure:
- require_zero_offset(): EINVAL for non-zero read/write offsets
- validate_kfmap_flags(): KFMAP flag validation (MAP_SHARED/PRIVATE)
- ContextHandle::Ctx: atomic FullContextRegs save/restore
- kwriteoff: offset parameter for regs/ctx/attr/start writes
- try_stop_context: preserve HardBlocked::NotYetStarted status on restore
2026-07-08 17:47:20 +03:00
vasilito
ca67b1da37
0.3.0: converge kernel onto upstream master
...
- Rebase all Red Bear kernel changes onto upstream master (4d5d36d4 ).
- Update version to 0.5.12+rb0.3.0 and add Red Bear author attribution.
- Switch redox_syscall direct dependency to local fork path (../syscall).
- Bump rust-toolchain.toml to nightly-2026-05-24.
- Regenerate Cargo.lock for +rb0.3.0 suffixes and path deps.
2026-07-06 18:43:52 +03:00
Wildan M
622a4fb3cd
Solve context leak when switching
2026-06-19 17:33:46 +07:00
Wildan M
101f090ef9
Fmt
2026-06-19 16:50:14 +07:00
Akshit Gaur
b93260ed2d
Migrating run_queue to BTreeMap
2026-06-18 10:39:33 +05:30
4lDO2
42613ddc06
WIP: simultaneous NMI-based user+kernel profiling.
2026-06-03 19:01:35 +02:00
Akshit Gaur
58283f63fe
EEVDF
2026-05-30 08:39:48 -06:00
Wildan M
bd44956e96
Capture event stat, change stat source for contexts
2026-05-12 12:24:49 +07:00
Speedy_Lex
f49c7d991a
RSDP validation and fixing a few clippy lints
2026-05-05 19:35:31 +02:00
Wildan M
85c98314a9
Unwrap select_next_context result
2026-05-02 06:23:13 -06:00
Wildan M
a297bfcc82
Use smallvec for memory and notify_files
2026-04-30 22:00:35 +07:00
Wildan M
fb137f8001
Avoid reaccessing AddrSpace when switching
2026-04-30 11:09:59 -06:00
Wildan M
ab08d47aa8
Add commented out switch debug print
2026-04-29 11:21:20 +07:00
Wildan M
e7ac009f31
Fix deadlock on contended switch
2026-04-29 11:21:02 +07:00
Wildan M
baf329c120
Fix dead contexts clobber idle pools
2026-04-29 11:20:21 +07:00
Wildan M
2df7467d13
Use weak ContextRef for run contexts
2026-04-26 12:08:24 +07:00
Wildan M
ea1d915bbc
Make wake up optional
2026-04-26 07:15:10 +07:00
Wildan M
0534ab6377
Replace enqueue with dedicated idle contexts
2026-04-26 06:49:55 +07:00
Wildan M
de7926e05e
Do not push idle context to queue
2026-04-26 06:49:54 +07:00
Wildan M
7adceb6e80
Add idle context
2026-04-26 06:49:54 +07:00
bjorn3
7827cb6c78
Unify context list again now that we have a run queue
...
This simplifies code and ensures that exiting a context will properly
remove it from the list of contexts.
2026-04-26 06:49:54 +07:00
Wildan M
f773d3e50d
don't loop from idle to kernel context
2026-04-23 16:40:12 +07:00
Wildan M
8262fa7da9
Don't account idle time
2026-04-23 16:33:15 +07:00
bjorn3
30b967022f
Fix a couple of warnings
2026-04-17 20:20:16 +02:00
Akshit Gaur
976756991a
Deficit Weighted Round Robin Scheduler
2026-04-17 06:52:03 -06:00
Speedy_Lex
ee1260363c
Fix many clippy lints
2026-04-08 19:40:41 +01:00
Wildan M
3b5a0e4c60
Apply ordered lock to AddrSpaceWrapper without solving borrow checker
2026-04-01 08:42:18 -06:00
Wildan M
6e0143cf0d
Store context to per cpu
2026-03-31 15:29:47 +07:00
Ron Williams
fde164b2a0
Revert "Deficit based Weighted Round Robin Scheduler"
...
This reverts commit b7dabfc3c2 .
2026-03-22 18:44:41 +00:00
Akshit Gaur
b7dabfc3c2
Deficit based Weighted Round Robin Scheduler
2026-03-22 07:00:31 -06:00
bjorn3
ea847f428f
Fix compilation with the debugger feature enabled
2026-03-07 12:19:24 +01:00
auronandace
14b8c2b0c1
enforce two lints and collapse some ifs
2026-03-03 14:51:32 +00:00
Wildan M
3c2b1a11c5
Add ordered lock for time offset mutex
2026-02-25 11:42:17 +07:00
bjorn3
7ff1898765
Fix a couple of warnings
2026-02-06 20:54:42 +01:00
Jeremy Soller
1c850605d0
Only read time once during context switch
2026-01-20 14:18:33 -07:00
Jeremy Soller
81a49d211b
Fix potential preempt guard deadlock
2026-01-20 13:58:31 -07:00
Anhad Singh
d9eae6bb75
fix(sync/wait_condition): deadlock in WaitCondition::wait
...
Instead of using a simple switch to determine if preemption is enabled
(`is_preemptable: bool`), a counter is used instead. This handles the
case where a function holding a `PreemptGuard` calls another function
that creates a new `PreemptGuard`.
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2025-12-15 13:05:29 +11:00
Anhad Singh
4ff82ad8b5
fix(scheme/user): deadlocks inside call_extended_inner
...
Signed-off-by: Anhad Singh <andypython@protonmail.com >
2025-11-27 14:39:14 +11:00
Jeremy Soller
60af085356
Improve cpu stat accuracy
2025-11-03 20:42:08 -07:00
Speedy_Lex
0931a7f49f
Resolve a huge portion of the clippy lints
2025-10-06 06:30:23 -06:00
Jeremy Soller
5dc6f7c3ba
lock ordering
2025-09-22 07:48:48 -06:00
bjorn3
4884d749af
Make PercpuBlock const constructable
2025-09-15 19:00:03 +02:00
bjorn3
61db2b2ad5
Use core::hint::spin_loop() where possible
2025-09-13 18:55:16 +02:00
Jeremy Soller
8a2aa411e2
Explicitly scope all locks, fixing multi_core hangs. Allow contexts on any CPU
2025-09-13 10:10:07 -06:00
bjorn3
cea93f7647
cargo fix --edition & rustfmt
...
Or to be precise:
RUST_TARGET_PATH=$(pwd)/targets cargo fix --edition \
--target targets/x86_64-unknown-kernel.json \
--target targets/i686-unknown-kernel.json \
--target targets/aarch64-unknown-kernel.json \
--target targets/riscv64-unknown-kernel.json \
-Zbuild-std=core,alloc --allow-dirty --bin kernel
cargo fmt
2025-09-10 16:44:36 +02:00
bjorn3
b5822ac118
Mostly use cfg!() rather than #[cfg] for controlling sys_stat
...
This only adds 48 bytes overhead per cpu core in the PerCpuBlock struct.
Also fixes compilation with sys_stat enabled on x86_64.
2025-09-07 12:27:04 +02:00
bjorn3
75edd1d34c
Fix infinite panicking when panicking during early boot
2025-04-21 16:44:27 +02:00
4lDO2
1d5f8fd46d
Move proc code to userspace.
2025-04-19 16:30:42 +02:00
Vincent Berthier
2da88c18c0
Add the sys:stat scheme
2025-02-22 14:27:10 +00:00
Arthur Paulino
e19c1404f7
chore: enrich context/switch
...
* Add documentation and more code comments to `src/context/switch.rs`
* Eliminate a `context.wake.expect(...)` where `context.wake.is_some()`
* Eliminate a TODO item about updating contexts' timestamps in `switch_to`
* Eliminate a dangling `else { continue }` at the end of the loop that iterates
on contexts
2024-10-31 10:22:21 +00:00