Skip to content

Commit 1a065c3

Browse files
LinuxDev9002claude
andcommitted
docs: add extension model methodology, opus full review v3, and top venue paper guide; merge overleaf arq comments
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3384956 commit 1a065c3

4 files changed

Lines changed: 376 additions & 1 deletion

File tree

docs/paper

Submodule paper updated from 667adbb to 0a0f4a9
Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
# Extension Execution Models in Systems Papers (SOSP/OSDI)
2+
3+
## What reviewers want to see
4+
5+
An extension execution model must answer four questions clearly:
6+
7+
1. **Where does extension code run?** (execution context)
8+
2. **When does it run?** (trigger / attachment point)
9+
3. **What can it do?** (capabilities and effects)
10+
4. **What can't it do?** (safety boundary)
11+
12+
The best systems papers present these as a single coherent model, not a feature list.
13+
14+
## Successful models from prior work
15+
16+
### sched_ext: struct_ops callbacks
17+
- **Where**: in the kernel scheduler, replacing specific scheduling decisions
18+
- **When**: at well-defined scheduling events (enqueue, dispatch, runnable, stopping)
19+
- **What**: return scheduling decisions (which CPU, which queue, timeslice)
20+
- **Safety**: BPF verifier guarantees termination and memory safety; fallback to default scheduler on error
21+
- **Model in one sentence**: "User-supplied BPF programs replace scheduling policy decisions at defined hook points, with automatic fallback."
22+
23+
### XDP: packet processing
24+
- **Where**: at the network driver level, before the kernel networking stack
25+
- **When**: on every incoming packet
26+
- **What**: return an action (drop, pass, redirect, tx) + optionally modify packet
27+
- **Safety**: BPF verifier; bounded execution time; no sleeping
28+
- **Model in one sentence**: "A BPF program runs on every packet at the driver level and returns an action."
29+
30+
### XRP: storage
31+
- **Where**: in the NVMe driver, on the I/O completion path
32+
- **When**: on I/O completion, chaining subsequent I/Os without returning to user-space
33+
- **What**: issue follow-up I/O requests (B-tree traversal, log-structured merge)
34+
- **Safety**: BPF verifier; limited to I/O operations
35+
- **Model in one sentence**: "BPF programs chain storage I/Os at the driver level without returning to user-space between operations."
36+
37+
### Bento: file system in user-space with kernel safety
38+
- **Where**: kernel VFS layer, replacing file system operations
39+
- **When**: on VFS calls (read, write, lookup)
40+
- **What**: implement full file system logic in Rust with kernel safety
41+
- **Safety**: Rust type system + kernel API restrictions
42+
- **Model in one sentence**: "Safe user-written file system logic runs at the VFS layer, replacing kernel file system implementations."
43+
44+
## Common patterns
45+
46+
### The "single attachment point" model
47+
Most successful extension models have ONE primary attachment point:
48+
- sched_ext: the scheduler
49+
- XDP: the packet receive path
50+
- XRP: the I/O completion path
51+
52+
The model is simple: extension code runs at ONE point, receives context, returns a decision. Complexity comes from what the code can express, not from how many places it runs.
53+
54+
### The "action return" model
55+
Extension code returns a discrete action (XDP_DROP, SCX_DSQ_LOCAL, etc.) or modifies shared state (BPF maps). It does not have unbounded side effects. The caller (kernel subsystem) acts on the return value. This makes the safety boundary clear: the extension advises, the kernel acts.
56+
57+
### The "fallback" model
58+
If extension code fails (verifier rejects, runtime error, timeout), the system falls back to default behavior. This is critical for production deployment: the extension is an optimization, not a requirement.
59+
60+
## What makes a model strong at SOSP/OSDI
61+
62+
### Clarity
63+
The model should be explainable in one sentence. If you need a paragraph to explain when/where/how extension code runs, the model is too complex.
64+
65+
### Minimality
66+
The fewest concepts needed to express the model. Every additional hook point, trigger type, or mechanism is complexity that must be justified. "Three composable mechanism layers" is three times harder to review than "one hook point with async continuation."
67+
68+
### Clean safety boundary
69+
Reviewer must immediately understand: what CAN'T the extension do? What happens if it goes wrong? The boundary should be structural (enforced by verifier/type system), not policy-based (enforced by convention).
70+
71+
### Abstraction level
72+
The model should be described at the right abstraction level. Too high: "we make the GPU programmable" (meaningless). Too low: "we use sleepable kfuncs with bpf_wq in the UVM fault handler" (implementation detail). Right level: "BPF programs run at fault time and can initiate async effects that outlive the callback."
73+
74+
### Novelty in the model, not just the target
75+
"We applied the XDP model to GPUs" is weak. "We extended the BPF execution model to support async effects and device-side execution" is novel. The model itself should contribute something new, not just port an existing model to a new subsystem.
76+
77+
## Anti-patterns
78+
79+
### The "mechanism zoo"
80+
Listing many mechanisms (kfuncs, uprobes, struct_ops, bpf_wq, device-side BPF, SIMT verifier) without a unifying model. Reviewer sees complexity, not insight. Each mechanism is a feature, not a contribution.
81+
82+
### The "layer cake"
83+
"Three composable layers, each crossing a boundary." Sounds clean but raises questions: Do they compose? In what order? What happens at the interfaces? Can you use layer 2 without layer 1? The model is actually three separate models pretending to be one.
84+
85+
### The "checklist"
86+
"Our model provides safety, programmability, deployability, and observability." These are properties, not a model. A model is HOW you achieve properties, not a list of properties.
87+
88+
### The "taxonomy as contribution"
89+
"We identify three challenges and address each with a mechanism." This is a design methodology, not an execution model. Reviewers want to understand the runtime behavior, not the design process.
90+
91+
## How to present an extension model
92+
93+
### Structure
94+
1. **One sentence**: what the model IS (where extension code runs, what it can do)
95+
2. **Trigger**: when does it run
96+
3. **Capabilities**: what operations are available to extension code
97+
4. **Safety**: what the verifier/runtime guarantees
98+
5. **Example**: one concrete policy expressed in this model (3-5 lines of pseudocode)
99+
100+
### The acid test
101+
Can a reader who has never seen the system write a simple policy after reading the model description? If yes, the model is clear. If no, it is too abstract or too mechanism-heavy.
102+
103+
---
104+
105+
## gpu_ext model: versions discussed (2026-03-30)
106+
107+
### Prior art: Syrup (SOSP 2021)
108+
- "User-Defined Scheduling Across the Stack"
109+
- One BPF policy framework, multiple hook points across the stack (CFS, network queue, etc.)
110+
- Unified scheduling decisions across multiple subsystems
111+
- Key: multiple triggers + unified policy is NOT novel by itself — Syrup already did this
112+
113+
### Version M1: "Three composable mechanism layers" (current tex, old)
114+
- "Three mechanism layers, each crossing one boundary: sync/async, driver/app, host/device"
115+
- **Anti-pattern: layer cake.** Sounds clean but is actually three separate models pretending to be one.
116+
- Raises unanswered questions: do they compose? In what order? Can you use L2 without L1?
117+
- Rejected.
118+
119+
### Version M2: "sched_ext + async continuation" (discussed 2026-03-30)
120+
- "Advisory callbacks with async continuation in the GPU fault handler"
121+
- **Problem: sounds incremental.** "We added async to sched_ext" is not a SOSP contribution.
122+
- The framing misses the fundamental difference: we manage REMOTE resources, not local.
123+
- Rejected.
124+
125+
### Version M3: "Programmable policy proxy" (discussed 2026-03-30)
126+
- "The driver acts as a policy proxy for the GPU. We make this proxy programmable."
127+
- **Problem: "proxy" implies GPU has no policy.** GPU hardware HAS policies (warp scheduler, timeslice scheduler, TLB management). The driver doesn't "proxy" for a policy-less device — it implements ADDITIONAL policies (eviction ordering, migration scope, preemption decisions) that the hardware doesn't handle.
128+
- Also factually wrong about GPU hardware capabilities.
129+
- Rejected.
130+
131+
### Version M4: "Remote resource management via BPF" (current best candidate)
132+
133+
**Positioning**: Like Syrup and sched_ext, gpu_ext is a unified BPF policy framework with multiple trigger points in the driver. Unlike those systems, gpu_ext manages resources on a physically separate processor: policy decisions in the host driver must cross an interconnect to take effect.
134+
135+
**The model**:
136+
- **Where**: in the GPU driver (primarily the UVM fault handler)
137+
- **When**: triggered by GPU page faults (reactive) or application CUDA API calls (proactive)
138+
- **What**: BPF programs make advisory policy decisions (eviction ordering, prefetch scope, preemption) AND can initiate async effects (DMA migration, GPU preemption) that execute after the callback returns
139+
- **Safety**: BPF verifier guarantees termination and memory safety; fallback to default driver policy on error
140+
- **Model in one sentence**: "Verified BPF programs in the GPU driver make resource management decisions and initiate cross-device effects, with the execution model designed for the latency and opacity of managing a remote processor."
141+
142+
**What's novel vs Syrup/sched_ext** (not "we added async" — that's incremental):
143+
144+
| | Syrup / sched_ext | gpu_ext |
145+
|--|---|---|
146+
| Managed resource | Local (same processor) | Remote (separate processor, across interconnect) |
147+
| Effect latency | μs (context switch) | ms (DMA across interconnect) |
148+
| Observability | Host can inspect managed state | Device state architecturally opaque |
149+
| Callback model | Sync return → done | Sync return → async continuation needed |
150+
151+
The contribution is NOT "we added async to sched_ext." The contribution is: **we extended the BPF policy model from local resource management to remote resource management**, which required solving the temporal and informational gaps inherent in managing a physically separate processor.
152+
153+
**Auxiliary**: device-side BPF with SIMT-aware verifier provides observation of the remote processor's internal state. This is a separate facility, not part of the main driver-centric model. Honestly positioned as auxiliary (instrumentation only, no end-to-end policy gain yet).
154+
155+
**Design insight**: the fault handler is the natural hook point because GPU resource management couples memory (which pages to migrate) and scheduling (which context stalls) through data movement. Unlike CPU where sched_ext and cache_ext can be independent, GPU policy hooks must see both memory and scheduling state simultaneously.
156+
157+
**Answers to the four questions**:
158+
1. Where: GPU driver fault handler (host CPU)
159+
2. When: page fault (reactive) or CUDA API call (proactive)
160+
3. What: advisory decisions + async effects (DMA, preemption) via kfuncs
161+
4. What can't: bounded by BPF verifier; effects mediated by driver; fallback to default policy
162+
163+
**One-sentence summary**: "gpu_ext extends the BPF advisory callback model from local to remote resource management: verified programs in the GPU driver make policy decisions and initiate cross-device effects across the host-GPU interconnect."
164+
165+
### Open questions on M4
166+
- Is "remote resource management" a strong enough framing for SOSP? Or does it sound like distributed systems?
167+
- "Cross-device effects" — is this the right term?
168+
- How much of the device-side BPF story belongs in the intro vs Section 3?
169+
- Syrup comparison: do we need to explicitly compare to Syrup, or is sched_ext sufficient as baseline?
170+
171+
### yunwei37 critiques leading to these versions
172+
- M1 "three layers": "也 merge 了很多混乱的东西" — too many mechanisms without unified model
173+
- M2 "sched_ext + async": "听起来像是 incremental 加了一个啥辅助机制" — sounds like a minor addition
174+
- M3 "programmable proxy": "GPU 没有 hardware policy — 谁告诉你的?" — factually wrong about GPU hardware
175+
- M4 "remote resource management": yunwei37 questioned — "这里面真的解决的是 remote 的问题吗?异构或者 co-located 的说法会不会更好?"
176+
177+
---
178+
179+
## Terminology discussion (2026-03-30)
180+
181+
### "Remote" vs "Heterogeneous" vs "Cross-device" vs "Accelerator" vs "Co-location"
182+
183+
These terms describe different aspects of the same hardware situation:
184+
185+
| Term | What it describes | Level |
186+
|------|------------------|-------|
187+
| Remote | Physical distance + latency | Distance |
188+
| Heterogeneous | Different kinds of processors | Hardware architecture |
189+
| Cross-device | Different physical devices | Physical topology |
190+
| Accelerator | Purpose-built processor managed by host | Role/function |
191+
| Co-location (breaking) | Policy executor ≠ managed resource context | Policy design consequence |
192+
193+
**Remote** — implies network distance. GPU is on the same machine, same board, sometimes same package (Grace Hopper). "Remote" sounds like distributed systems. WRONG for GPU.
194+
195+
**Heterogeneous** — means different kinds of processors. Correct (CPU + GPU = heterogeneous), but too broad. ARM big.LITTLE is also heterogeneous, but has same ISA, shared memory, none of our mismatches.
196+
197+
**Cross-device** — means across different hardware devices. More precise than "remote" (no network implication), more specific than "heterogeneous" (implies physical separation). Neutral, descriptive. Captures "different device" but not "different ISA."
198+
199+
**Accelerator** — specialized processor designed for specific workloads, managed by a host CPU. Naturally includes four properties: (1) separate device, (2) specialized ISA, (3) host-managed, (4) interconnect-connected. More specific than "heterogeneous" (big.LITTLE is NOT an accelerator). Good for generalization (GPU, FPGA, TPU, SmartNIC all are accelerators).
200+
201+
**Co-location (breaking)** — not a hardware description. Describes the CONSEQUENCE for extensibility design: sched_ext assumes policy executor and managed resource are on the same processor. GPU breaks this assumption. This is the insight, not the hardware.
202+
203+
### Relationship between terms
204+
205+
Causal chain: GPU is an **accelerator** (role) → it is a **cross-device** separate processor (topology) → it is **heterogeneous** (different ISA) → policy and resource are **not co-located** (design consequence) → CPU extensibility patterns **break**.
206+
207+
"Cross-device" and "heterogeneous" are hardware facts. "Co-location breaks" is the design consequence. "Accelerator" is the role description that encompasses both facts.
208+
209+
### yunwei37's position
210+
- "Remote" is wrong (GPU is not remote)
211+
- Not sure a single term is needed
212+
- Maybe just describe the fact: "GPU is a separate device with its own ISA. Policy runs on host CPU, effects happen on GPU."
213+
- Co-location is not a "层面 (level)" — it's just a fact: sched_ext assumes same processor, GPU isn't.
214+
- "Cross-device" is close to the antonym of "co-located" but doesn't fully capture "different ISA" and "different execution model"
215+
216+
### Conclusion
217+
No single term perfectly captures the situation. Best approach: **describe the fact, don't rely on a term.**
218+
219+
> "GPU is a separate device with its own ISA and execution model. Policy runs on the host CPU, effects happen on the GPU. This is unlike CPU extensibility where policy and resource share the same processor."
220+
221+
Use contrast (unlike CPU...) rather than jargon (breaks the co-location assumption). The reader understands immediately without needing to learn a new term.
222+
223+
If a term IS needed for shorthand, **"accelerator"** is the best single word — it naturally implies separate device + specialized ISA + host-managed. "Accelerator extensibility" as a research area is well-scoped and not confusable with distributed systems or big.LITTLE.
224+
225+
---
226+
227+
## What makes our model a contribution (discussion, 2026-03-30)
228+
229+
### What reviewers want (from `what_makes_top_venue_paper.md`)
230+
1. New abstraction that changes thinking
231+
2. Surprising result
232+
3. Previously impossible capability
233+
4. The right solution to a hacked-around problem
234+
235+
### How our model fits
236+
- **New abstraction**: GPU resource management as a programmable OS subsystem (like CPU scheduling became programmable via sched_ext). Not just "applied BPF to GPU" — the model handles challenges that don't exist for CPU extensibility.
237+
- **Previously impossible**: before gpu_ext, you could not safely load custom GPU resource management policy at runtime. Now you can, and agents can explore the policy space.
238+
- **The right solution**: people have been hacking GPU policy in user-space (Paella, XSched) or modifying driver source (GDEV, GCAPS). BPF in the driver is the principled answer.
239+
240+
### What's NOT the contribution
241+
- "We added async to sched_ext" (incremental)
242+
- "Three composable mechanism layers" (feature list)
243+
- "We identify two mismatches" (taxonomy)
244+
245+
### What IS the contribution
246+
The model itself: verified BPF programs in the GPU driver can express resource management policies that were previously hardcoded, with the execution model handling the fact that policy runs on a different processor than the managed resource. This is a new kind of OS extensibility — extending a kernel subsystem that manages a separate, architecturally distinct device.

0 commit comments

Comments
 (0)