Commit a8876ec
zc-stack-spec-leader
docs(zc_stack_user_spec): native ZC-send spec (30-40, S2-S8)
Adds the implementation-grade spec set for migrating FSTACK_ZC_SEND from
the FSTACK_ZC_MAGIC + m_uiotombuf hack to the FreeBSD-native sosend(top)
path via a new symmetric kern_zc_sendit kernel entry. Spec only; no
implementation in this round.
12 new docs under docs/zc_stack_user_spec/zh_cn/:
30-spec-overview scope C+A+A decisions, glossary, motivation
(incl. F-Stack issue #712 + 2-3% perf data)
31-current-state-and-rem 17-row modification map of the existing
FSTACK_ZC_SEND hack + per-line removal
anchors (c-precision-surgery format)
32-native-arch-design symmetric arch with kern_zc_recvit (5-axis
mirror table); diagrams of old vs new path
33-kernel-patch-spec kern_zc_sendit decl + impl with full code,
error/MAC/SIGPIPE handling; m_uiotombuf
rollback to vanilla; sys_generic.c
uio_offset guard removal
34-userspace-api-spec ff_zc_send rewrite (kern_writev->kern_zc_sendit),
ff_zc_mbuf_get +M_PKTHDR, ff_zc_mbuf_write
maintains pkthdr.len; ABI invariance
35-mbuf-lifecycle-spec S0-S4 ownership state machine, INV-1/2/3
invariants, sosend error-path m_freem matrix
36-boundary-and-fallback socket-type x flag matrix, atomic+sb_max
constraint (root cause of issue #712)
37-test-spec CMocka unit (12) + integration (10) +
INV memory-safety cases (5)
38-perf-baseline-spec wrk T1/T2/T3 + large-payload P1-P4 with
AC3 dlt<=3% threshold, references 21-m2
39-migration-guide ABI-stable migration steps; emphasizes
'make clean' (M2 incremental-build trap)
40-acceptance-and-milestones AC1-6 + M0-M5 implementation milestones
49-spec-review gatekeeper audit (D1 18/18 PASS after R1
anchor fix; D2/D3/D4 PASS); bounce
counter max=1 (per memory rule 86071475)
All claims grounded in actual code (uipc_socket.c:2599 sosend, :2325
atomic, :2338-2343 resid 3-way, :2456-2462 if uio==NULL, :2354 EOR
EINVAL, mbuf.h:1856-1869 MAGIC, etc). External cross-check: FreeBSD
sosend(9) manpage (R. Watson, FreeBSD 7.0+), F-Stack issue #712
(open since 2022-11), Tencent Cloud article on current 2-3% gain.
S5 had 1 bounce (D1 #10b sys_generic.c anchor context misaligned in
33 §5.1 / 31 §3.3, fixed in R1; bounce counter < 3, no human escalation).1 parent 303609e commit a8876ec
12 files changed
Lines changed: 2704 additions & 0 deletions
File tree
- docs/zc_stack_user_spec/zh_cn
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
0 commit comments