SchOS/kernel
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nexoniarz 08e7878d8c schfs: read a whole block per tree descent, not half of one
BOUNCE was 2048 while the comment directly above it said "one page at a
time", and the buffer it sizes is a single kalloc() -- so half of every
bounce buffer went unused and every read did twice the work it needed to.

The chunk size is not a copy-size tuning knob. Each trip through the loop
takes the volume sleeplock and builds a fresh B-tree cursor to find the
extent for that offset, so it really sets how many tree descents happen
per byte read. An 834 KB file took 417 of them; it now takes 209.

Measured in the guest, bracketed inside one command line so nothing
depends on host timing: reading 834 KB goes from 1.73s to 0.90s under
TCG, cold and warm alike. Warm equalling cold is itself the tell -- the
cost was never the disk, it was the per-chunk work, which is why KVM was
6.4x faster on the same read while caching made no difference at all.

This does not fix `ls`, and the numbers say why: 2.80s -> 2.65s cold.
loaduvm already reads a page at a time, so exec was never the bottleneck
there. At 241 entries in 2.65s that is ~11ms per file, spent in the
per-entry lookup path rather than in reading anything.

schfs-check passes; bootcheck 108 [ok].

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09 23:41:11 +02:00
..
arch/x86_64 acpi: take the RSDP from the loader when firmware gives it to us 2026-08-09 22:02:57 +02:00
core Free every usable memory region, not one contiguous run 2026-08-09 20:03:51 +02:00
dev Give userspace a raw disk: /dev/hda and /dev/hdb 2026-08-09 22:19:40 +02:00
drivers Map device registers with ioremap instead of assuming a low BAR 2026-08-09 21:31:01 +02:00
fs schfs: read a whole block per tree descent, not half of one 2026-08-09 23:41:11 +02:00
net Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00
proc init survives stray signals; commands are 4-34x faster 2026-08-09 15:54:05 +02:00
sys Give userspace a raw disk: /dev/hda and /dev/hdb 2026-08-09 22:19:40 +02:00
kernel.ld Initial commit: Schunix as it stands before the SchOS rename 2026-08-09 13:47:01 +02:00