Reduced the scope of LFS3_REVDBG/REVNOISE
LFS3_REVDBG introduced a lot of overhead for something I'm not sure
anyone will actually use (I have enough tooling that the state of an
rbyd is rarely a mystery, see dbgbmap.py). That, and we're running out
of flags!
So this reduces LFS3_REVDBG to just store one of "himb" in the first
(lowest) byte of the revision count; information that is easily
available:
vvvv---- -------- -------- --------
vvvvrrrr rrrrrr-- -------- --------
vvvvrrrr rrrrrrnn nnnnnnnn nnnnnnnn
vvvvrrrr rrrrrrnn nnnnnnnn dddddddd
'-.''----.----''----.- - - '---.--'
'------|----------|----------|---- 4-bit relocation revision
'----------|----------|---- recycle-bits recycle counter
'----------|---- pseudorandom noise (if revnoise)
'---- h, i, m, or b (if revdbg)
-11-1--- - h = mroot anchor
-11-1--1 - i = mroot
-11-11-1 - m = mdir
-11---1- - b = btree node
Some other notes:
- Enabled LFS3_REVDBG and LFS3_REVNOISE to work together, now that
LFS3_REVDBG doesn't consume all unused rev bits.
Note that LFS3_REVDBG has priority over LFS3_REVNOISE, but _not_
recycle-bits, etc. Otherwise problems would happen for recycle-bits
>2^20 (though do we care?).
- Fixed an issue where using the gcksum as a noise source results in
noise=0 when there is only an mroot. This is due to how we xor out
the current mdir cksum during an mdir commit.
Fixed by using gcksum_p instead of gcksum.
- Added missing LFS3_I_REVDBG/REVNOISE flags in the tests, so now you
can actually run the tests with LFS3_REVDBG/REVNOISE (this probably
just fell out-of-date at some point).
---
Curiously, despite LFS3_REVDBG/REVNOISE being disabled by default, this
did save some code. I'm guessing the non-tail-call mtree/gbmap commit
functions prevented some level of inlining?:
code stack ctx
before: 35964 2280 660
after: 35964 (+0.0%) 2280 (+0.0%) 660 (+0.0%)
code stack ctx
gbmap before: 38940 2296 772
gbmap after: 38828 (-0.3%) 2296 (+0.0%) 772 (+0.0%)
This commit is contained in:
+36
-18
@@ -30,9 +30,8 @@ defines.COMPACTMETA = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
if = [
|
||||
'LFS3_IFDEF_REVDBG(true, !REVDBG)',
|
||||
'LFS3_IFDEF_REVNOISE(true, !REVNOISE)',
|
||||
'!REVDBG || !REVNOISE',
|
||||
'LFS3_IFDEF_YES_REVDBG(REVDBG, LFS3_IFDEF_REVDBG(true, !REVDBG))',
|
||||
'LFS3_IFDEF_YES_REVNOISE(REVNOISE, LFS3_IFDEF_REVNOISE(true, !REVNOISE))',
|
||||
'LFS3_IFDEF_CKPROGS(true, !CKPROGS)',
|
||||
'LFS3_IFDEF_CKFETCHES(true, !CKFETCHES)',
|
||||
'LFS3_IFDEF_CKMETAPARITY(true, !CKMETAPARITY)',
|
||||
@@ -77,8 +76,8 @@ code = '''
|
||||
((RDONLY) ? LFS3_I_RDONLY : 0)
|
||||
| ((FLUSH) ? LFS3_I_FLUSH : 0)
|
||||
| ((SYNC) ? LFS3_I_SYNC : 0)
|
||||
| ((REVDBG) ? LFS3_IFDEF_REVDBG(LFS3_M_REVDBG, -1) : 0)
|
||||
| ((REVNOISE) ? LFS3_IFDEF_REVNOISE(LFS3_M_REVNOISE, -1) : 0)
|
||||
| ((REVDBG) ? LFS3_IFDEF_REVDBG(LFS3_I_REVDBG, -1) : 0)
|
||||
| ((REVNOISE) ? LFS3_IFDEF_REVNOISE(LFS3_I_REVNOISE, -1) : 0)
|
||||
| ((CKPROGS) ? LFS3_IFDEF_CKPROGS(LFS3_I_CKPROGS, -1) : 0)
|
||||
| ((CKFETCHES) ? LFS3_IFDEF_CKFETCHES(LFS3_I_CKFETCHES, -1) : 0)
|
||||
| ((CKMETAPARITY)
|
||||
@@ -112,9 +111,8 @@ defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.GBMAP = [false, true]
|
||||
if = [
|
||||
'LFS3_IFDEF_REVDBG(true, !REVDBG)',
|
||||
'LFS3_IFDEF_REVNOISE(true, !REVNOISE)',
|
||||
'!REVDBG || !REVNOISE',
|
||||
'LFS3_IFDEF_YES_REVDBG(REVDBG, LFS3_IFDEF_REVDBG(true, !REVDBG))',
|
||||
'LFS3_IFDEF_YES_REVNOISE(REVNOISE, LFS3_IFDEF_REVNOISE(true, !REVNOISE))',
|
||||
'LFS3_IFDEF_CKPROGS(true, !CKPROGS)',
|
||||
'LFS3_IFDEF_CKFETCHES(true, !CKFETCHES)',
|
||||
'LFS3_IFDEF_CKMETAPARITY(true, !CKMETAPARITY)',
|
||||
@@ -145,7 +143,9 @@ code = '''
|
||||
struct lfs3_fsinfo fsinfo;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
LFS3_IFDEF_YES_REVDBG(LFS3_I_REVDBG, 0)
|
||||
| LFS3_IFDEF_YES_REVNOISE(LFS3_I_REVNOISE, 0)
|
||||
| LFS3_I_MKCONSISTENT
|
||||
| LFS3_I_RELOOKAHEAD
|
||||
| LFS3_I_COMPACTMETA
|
||||
| LFS3_I_CKMETA
|
||||
@@ -172,7 +172,9 @@ code = '''
|
||||
struct lfs3_fsinfo fsinfo;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
LFS3_IFDEF_YES_REVDBG(LFS3_I_REVDBG, 0)
|
||||
| LFS3_IFDEF_YES_REVNOISE(LFS3_I_REVNOISE, 0)
|
||||
| LFS3_I_MKCONSISTENT
|
||||
| LFS3_I_RELOOKAHEAD
|
||||
| LFS3_I_COMPACTMETA
|
||||
| LFS3_I_CKMETA
|
||||
@@ -189,7 +191,9 @@ code = '''
|
||||
CFG) => 0;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
LFS3_IFDEF_YES_REVDBG(LFS3_I_REVDBG, 0)
|
||||
| LFS3_IFDEF_YES_REVNOISE(LFS3_I_REVNOISE, 0)
|
||||
| LFS3_I_MKCONSISTENT
|
||||
| LFS3_I_COMPACTMETA
|
||||
// note ckdata implies ckmeta
|
||||
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
|
||||
@@ -219,7 +223,9 @@ code = '''
|
||||
struct lfs3_fsinfo fsinfo;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
LFS3_IFDEF_YES_REVDBG(LFS3_I_REVDBG, 0)
|
||||
| LFS3_IFDEF_YES_REVNOISE(LFS3_I_REVNOISE, 0)
|
||||
| LFS3_I_MKCONSISTENT
|
||||
| LFS3_I_RELOOKAHEAD
|
||||
| LFS3_I_COMPACTMETA
|
||||
| LFS3_I_CKMETA
|
||||
@@ -241,7 +247,9 @@ code = '''
|
||||
lfs3_mount(&lfs3, LFS3_M_RDWR, CFG) => 0;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
LFS3_IFDEF_YES_REVDBG(LFS3_I_REVDBG, 0)
|
||||
| LFS3_IFDEF_YES_REVNOISE(LFS3_I_REVNOISE, 0)
|
||||
| LFS3_I_MKCONSISTENT
|
||||
| LFS3_I_RELOOKAHEAD
|
||||
| LFS3_I_REGBMAP
|
||||
| LFS3_I_COMPACTMETA
|
||||
@@ -260,7 +268,9 @@ code = '''
|
||||
CFG) => 0;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
LFS3_IFDEF_YES_REVDBG(LFS3_I_REVDBG, 0)
|
||||
| LFS3_IFDEF_YES_REVNOISE(LFS3_I_REVNOISE, 0)
|
||||
| LFS3_I_MKCONSISTENT
|
||||
| LFS3_I_COMPACTMETA
|
||||
// note ckdata implies ckmeta
|
||||
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
|
||||
@@ -316,7 +326,9 @@ code = '''
|
||||
struct lfs3_fsinfo fsinfo;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
LFS3_IFDEF_YES_REVDBG(LFS3_I_REVDBG, 0)
|
||||
| LFS3_IFDEF_YES_REVNOISE(LFS3_I_REVNOISE, 0)
|
||||
| LFS3_I_MKCONSISTENT
|
||||
| LFS3_I_RELOOKAHEAD
|
||||
| LFS3_IFDEF_YES_GBMAP(
|
||||
(SIZE >= BLOCK_SIZE/4) ? LFS3_I_REGBMAP : 0,
|
||||
@@ -337,7 +349,9 @@ code = '''
|
||||
CFG) => 0;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
LFS3_IFDEF_YES_REVDBG(LFS3_I_REVDBG, 0)
|
||||
| LFS3_IFDEF_YES_REVNOISE(LFS3_I_REVNOISE, 0)
|
||||
| LFS3_I_MKCONSISTENT
|
||||
| ((!RELOOKAHEAD) ? LFS3_I_RELOOKAHEAD : 0)
|
||||
| LFS3_IFDEF_YES_GBMAP(
|
||||
(SIZE >= BLOCK_SIZE/4) ? LFS3_I_REGBMAP : 0,
|
||||
@@ -426,7 +440,9 @@ code = '''
|
||||
struct lfs3_fsinfo fsinfo;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
LFS3_IFDEF_YES_REVDBG(LFS3_I_REVDBG, 0)
|
||||
| LFS3_IFDEF_YES_REVNOISE(LFS3_I_REVNOISE, 0)
|
||||
| LFS3_I_MKCONSISTENT
|
||||
| LFS3_I_RELOOKAHEAD
|
||||
| LFS3_IFDEF_YES_GBMAP(
|
||||
(ORPHANS >= 100) ? LFS3_I_REGBMAP : 0,
|
||||
@@ -448,7 +464,9 @@ code = '''
|
||||
CFG) => 0;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
((!RELOOKAHEAD) ? LFS3_I_RELOOKAHEAD : 0)
|
||||
LFS3_IFDEF_YES_REVDBG(LFS3_I_REVDBG, 0)
|
||||
| LFS3_IFDEF_YES_REVNOISE(LFS3_I_REVNOISE, 0)
|
||||
| ((!RELOOKAHEAD) ? LFS3_I_RELOOKAHEAD : 0)
|
||||
| LFS3_IFDEF_YES_GBMAP(
|
||||
(ORPHANS >= 100) ? LFS3_I_REGBMAP : 0,
|
||||
0)
|
||||
|
||||
Reference in New Issue
Block a user