Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DDSO — Dynamic Disk Scheduling Optimizer

A Linux kernel I/O scheduler that dynamically switches between FIFO, SSTF, and BATCH scheduling algorithms at runtime based on real-time seek-variance telemetry. Includes a full observability stack: kernel tracepoints → WebSocket bridge → live dashboard.


Architecture

┌──────────────────────────────────────────────────────────────────┐
│  kernel/ddso.c   (Linux block-layer elevator module)            │
│  ┌──────────┐    ┌───────────────┐    ┌──────────────────────┐  │
│  │ FIFO     │◄──►│ Decision      │◄──►│ Variance Engine      │  │
│  │ SSTF     │    │ Engine        │    │ (seek_total,         │  │
│  │ BATCH    │    │ (hysteresis + │    │  seek_sq_total,      │  │
│  │          │    │  cooldown)    │    │  sample_count)       │  │
│  └──────────┘    └───────────────┘    └──────────────────────┘  │
│        ▲                                        │               │
│        │          trace_ddso_switch()            │               │
│        │          trace_ddso_dispatch()          ▼               │
│        └─────────── /sys/kernel/tracing/trace_pipe ─────────────┘
│                              │
├──────────────────────────────┼───────────────────────────────────┤
│  backend/                    │  (Node.js WebSocket bridge)      │
│  server.mjs                  ▼                                  │
│  ┌──────────────────────────────────────────────┐               │
│  │ Reads trace_pipe via WSL                     │               │
│  │ Parses ddso_switch + ddso_dispatch events    │               │
│  │ Broadcasts sampled telemetry over WebSocket  │               │
│  └──────────────────────────────────────────────┘               │
│                              │                                  │
├──────────────────────────────┼───────────────────────────────────┤
│  frontend/                   ▼  (Next.js + React dashboard)     │
│  ┌──────────────────────────────────────────────┐               │
│  │ AlgorithmIndicator — live algo display        │               │
│  │ RealTimeGraph — variance + depth charts       │               │
│  │ TraceStream — raw event log                   │               │
│  │ WorkloadControl — fio trigger buttons          │               │
│  └──────────────────────────────────────────────┘               │
└──────────────────────────────────────────────────────────────────┘

Components

Directory Description
kernel/ Linux kernel module (ddso.c, ddso_trace.h, Makefile/Kbuild)
backend/ Node.js WebSocket server bridging kernel traces to the browser
frontend/ Next.js dashboard with real-time visualization components
scripts/ Workload configs, device setup, and startup scripts
docs/ Architecture, decision engine, and validation documentation
artifacts/ Verified trace outputs and validation evidence

Decision Engine

The scheduler uses seek-variance to determine the optimal algorithm:

Condition Selected Algorithm
variance < (1 << 13) FIFO (sequential)
variance > (1 << 17) SSTF (seek-optimal)
queued >= 8 && variance > (1<<16) BATCH (throughput)

Anti-thrashing safeguards:

  • Hysteresis: stable_counter >= 16 consecutive samples before switching
  • Cooldown: Minimum 50ms between algorithm transitions
  • Sample window: 256-sample exponential decay for variance calculation

Quick Start

Prerequisites

  • WSL2 with a custom kernel (or any Linux with kernel headers)
  • Node.js 18+
  • fio, trace-cmd installed in WSL

1. Build the kernel module

cd kernel/
make KDIR=/path/to/kernel/build
sudo insmod ddso.ko
echo ddso | sudo tee /sys/block/loop0/queue/scheduler

2. Start the backend

cd backend/
node server.mjs

3. Start the frontend

cd frontend/
npm install
npm run dev
# Open http://localhost:3000

Contributors

Role GitHub Scope
Primary Owner @Rexy-5097 Kernel module, decision engine, architecture
Collaborator @AkankshuGuleria Frontend dashboard, visualization, scripts

License

Licensed under the GNU General Public License v2.0.

About

Dynamic Disk Scheduling Optimizer — Adaptive Linux kernel I/O scheduler

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages