Tuning defaults
Linux ships defaults that have to suit a database server, a phone and a laptop at once. SakuraOS is only ever a desktop, so the defaults can be set for one job instead of averaged across three.
Memory and writeback
The kernel decides how much dirty data to hold in memory before writing it out. The stock setting is a percentage of RAM, which on a machine with 64 GB means many gigabytes of unwritten data and a stall when it finally flushes. SakuraOS sets absolute limits instead.
| Setting | Value | What it does |
|---|---|---|
vm.dirty_bytes | 256 MB | Hard ceiling on unwritten data, so a flush is never a multi-second freeze. |
vm.dirty_background_bytes | 64 MB | Start writing out quietly well before the ceiling. |
vm.dirty_writeback_centisecs | 15 s | How often the flusher wakes. Less often means fewer disk wake-ups on a laptop. |
vm.vfs_cache_pressure | 50 | Keep directory and inode caches longer. A desktop revisits the same paths constantly. |
vm.watermark_boost_factor | 0 | Disable a reclaim behaviour that causes stalls without helping an interactive workload. |
vm.compaction_proactiveness | 0 | Do not spend CPU compacting memory in the background on a machine with a person waiting. |
vm.page_lock_unfairness | 1 | Reduce the worst-case wait for a contended page, trading a little throughput for responsiveness. |
kernel.nmi_watchdog | 0 | A debugging feature that costs a timer on every CPU and helps nobody on a desktop. |
net.core.netdev_max_backlog | 4096 | A deeper queue before the network stack starts dropping on a fast link. |
kernel.kptr_restrict | 2 | Hide kernel pointers from userspace. This one is hardening, not performance. |
The I/O scheduler is chosen per drive
There is no single right scheduler, because the right answer depends on whether the device has to move a physical arm. A udev rule picks per device as it appears:
| Device | Scheduler | Why |
|---|---|---|
| Spinning disk | bfq | Seeking is expensive, so it is worth spending CPU ordering requests fairly. |
| SATA or USB SSD | mq-deadline | Cheap ordering with a latency bound, without BFQ's overhead. |
| NVMe | none | The device has its own deep queues. Scheduling in the kernel first only adds latency. |
Compressed swap in RAM
zram-generator provides a compressed swap device in memory. When
a machine runs short, pages are compressed rather than written to disk, which
is far faster than any SSD and does not wear it.
The practical effect is that a laptop with 8 GB and a browser full of tabs stays usable instead of having something killed. It is not a substitute for memory, but it moves the point at which a machine becomes unpleasant.
These are defaults, not policy. Everything here is a plain
file in /etc/sysctl.d and /etc/udev/rules.d. They
are marked as configuration, so if you change them your changes survive
updates rather than being overwritten.
The kernel is separate
Scheduling behaviour comes from the kernel itself rather than from these values. See Kernel.