Commit 1f3c47b
committed
Moved revision count noise behind ifdef LFS_NOISY
littlefs is intentionally designed to not rely on noise, even with cksum
collisions (hello, perturb bit!). So it makes sense for this to be an
optional feature, even if it's a small one.
Disabling revision count noise by default also helps with testing. The
whole point of revision count noise is to make cksum collisions less
likely, which is a bit counterproductive when that's something we want
to test!
This doesn't really change the revision count encoding:
vvvvrrrr rrrrrrnn nnnnnnnn nnnnnnnn
'-.''----.----''---------.--------'
'------|---------------|---------- 4-bit relocation revision
'---------------|---------- recycle-bits recycle counter
'---------- pseudorandom noise (optional)
I considered moving the recycle-bits down when we're not adding noise,
but the extra logic just isn't worth making the revision count a bit
more human-readable.
---
This saves a small bit of code in the default build, at the cost of some
code for the runtime checks in the LFS_NOISY build. Though I'm hoping
future config work will let users opt-out of these runtime checks:
code stack ctx
before: 38548 2624 640
default after: 38508 (-0.1%) 2624 (+0.0%) 640 (+0.0%)
LFS_NOISY after: 38568 (+0.1%) 2624 (+0.0%) 640 (+0.0%)
Honestly the thing I'm more worried about is using one of our precious
mount flags for this... There's not that many bits left!1 parent 6fb9211 commit 1f3c47b
File tree
6 files changed
+193
-138
lines changed- scripts
- tests
6 files changed
+193
-138
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6888 | 6888 | | |
6889 | 6889 | | |
6890 | 6890 | | |
| 6891 | + | |
| 6892 | + | |
| 6893 | + | |
| 6894 | + | |
| 6895 | + | |
| 6896 | + | |
6891 | 6897 | | |
6892 | 6898 | | |
6893 | 6899 | | |
| |||
7198 | 7204 | | |
7199 | 7205 | | |
7200 | 7206 | | |
7201 | | - | |
| 7207 | + | |
7202 | 7208 | | |
7203 | 7209 | | |
| 7210 | + | |
7204 | 7211 | | |
7205 | 7212 | | |
7206 | 7213 | | |
7207 | 7214 | | |
7208 | | - | |
7209 | | - | |
| 7215 | + | |
| 7216 | + | |
| 7217 | + | |
| 7218 | + | |
| 7219 | + | |
| 7220 | + | |
7210 | 7221 | | |
7211 | 7222 | | |
7212 | 7223 | | |
| |||
7223 | 7234 | | |
7224 | 7235 | | |
7225 | 7236 | | |
7226 | | - | |
7227 | | - | |
| 7237 | + | |
| 7238 | + | |
| 7239 | + | |
| 7240 | + | |
| 7241 | + | |
| 7242 | + | |
7228 | 7243 | | |
7229 | 7244 | | |
7230 | 7245 | | |
| |||
13421 | 13436 | | |
13422 | 13437 | | |
13423 | 13438 | | |
| 13439 | + | |
13424 | 13440 | | |
13425 | 13441 | | |
13426 | 13442 | | |
| |||
14249 | 14265 | | |
14250 | 14266 | | |
14251 | 14267 | | |
| 14268 | + | |
14252 | 14269 | | |
14253 | 14270 | | |
14254 | 14271 | | |
| |||
14262 | 14279 | | |
14263 | 14280 | | |
14264 | 14281 | | |
14265 | | - | |
14266 | | - | |
14267 | | - | |
14268 | 14282 | | |
14269 | 14283 | | |
14270 | 14284 | | |
14271 | 14285 | | |
14272 | 14286 | | |
14273 | 14287 | | |
14274 | 14288 | | |
| 14289 | + | |
14275 | 14290 | | |
14276 | 14291 | | |
14277 | 14292 | | |
| |||
14441 | 14456 | | |
14442 | 14457 | | |
14443 | 14458 | | |
| 14459 | + | |
14444 | 14460 | | |
14445 | 14461 | | |
14446 | 14462 | | |
14447 | 14463 | | |
14448 | 14464 | | |
14449 | 14465 | | |
14450 | | - | |
14451 | | - | |
14452 | 14466 | | |
14453 | 14467 | | |
14454 | 14468 | | |
14455 | 14469 | | |
| 14470 | + | |
14456 | 14471 | | |
14457 | 14472 | | |
14458 | 14473 | | |
| |||
14512 | 14527 | | |
14513 | 14528 | | |
14514 | 14529 | | |
| 14530 | + | |
14515 | 14531 | | |
14516 | 14532 | | |
14517 | 14533 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
165 | 168 | | |
166 | 169 | | |
167 | 170 | | |
| |||
185 | 188 | | |
186 | 189 | | |
187 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
188 | 194 | | |
189 | 195 | | |
190 | 196 | | |
| |||
210 | 216 | | |
211 | 217 | | |
212 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
213 | 222 | | |
214 | 223 | | |
215 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
189 | 192 | | |
190 | 193 | | |
191 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
192 | 201 | | |
193 | 202 | | |
194 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
| 102 | + | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| |||
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
| |||
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
| 89 | + | |
85 | 90 | | |
86 | 91 | | |
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
| 97 | + | |
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
| |||
98 | 104 | | |
99 | 105 | | |
100 | 106 | | |
| 107 | + | |
101 | 108 | | |
102 | 109 | | |
103 | 110 | | |
| |||
0 commit comments