Attempted alternate redund block layout in lfsr_mdir_t
The idea here is to revert moving redund blocks into lfsr_rbyd_t, and
instead just keep a redundant copy of the rbyd blocks in the redund
blocks in lfsr_mdir_t.
Surprisingly, extra overhead in lfsr_mdir_t ended up with worse stack
usage than extra overhead in lfsr_rbyd_t. I guess we end up allocated
more mdirs than rbyds, which makes a bit of sense given how complicated
lfsr_mdir_commit is:
code stack structs
redund union: 30976 2496 1072
redund in rbyd: 30948 (-0.1%) 2528 (+1.3%) 1100 (+2.6%)
redund in mdir: 31000 (+0.1%) 2536 (+1.6%) 1092 (+1.8%)
The mdir option does seem to improve struct overhead, but this hasn't
been a reliable measurement since it doesn't take into account how many
of each struct is allocated.
Given that the mdir option is inferior in both code and stack cost, and
requires more care to keep the rbyd/redund blocks in sync, I think I'm
going to revert this for now but keep the commit in the commit history
since it's an interesting comparison.
This commit is contained in:
+24
-27
@@ -176,23 +176,22 @@ code = '''
|
||||
if (tinfo.tag == LFSR_TAG_MDIR) {
|
||||
printf("traversal: 0x%x mdir 0x{%x,%x}\n",
|
||||
tinfo.tag,
|
||||
tinfo.u.mdir.rbyd.blocks[0],
|
||||
tinfo.u.mdir.rbyd.blocks[1]);
|
||||
tinfo.u.mdir.blocks[0],
|
||||
tinfo.u.mdir.blocks[1]);
|
||||
|
||||
// keep track of seen blocks
|
||||
seen[tinfo.u.mdir.rbyd.blocks[1] / 8]
|
||||
|= 1 << (tinfo.u.mdir.rbyd.blocks[1] % 8);
|
||||
seen[tinfo.u.mdir.rbyd.blocks[0] / 8]
|
||||
|= 1 << (tinfo.u.mdir.rbyd.blocks[0] % 8);
|
||||
seen[tinfo.u.mdir.blocks[1] / 8]
|
||||
|= 1 << (tinfo.u.mdir.blocks[1] % 8);
|
||||
seen[tinfo.u.mdir.blocks[0] / 8]
|
||||
|= 1 << (tinfo.u.mdir.blocks[0] % 8);
|
||||
|
||||
} else if (tinfo.tag == LFSR_TAG_BRANCH) {
|
||||
printf("traversal: 0x%x btree 0x%x.%x\n",
|
||||
tinfo.tag,
|
||||
tinfo.u.rbyd.blocks[0], tinfo.u.rbyd.trunk);
|
||||
tinfo.u.rbyd.block, tinfo.u.rbyd.trunk);
|
||||
|
||||
// keep track of seen blocks
|
||||
seen[tinfo.u.rbyd.blocks[0] / 8]
|
||||
|= 1 << (tinfo.u.rbyd.blocks[0] % 8);
|
||||
seen[tinfo.u.rbyd.block / 8] |= 1 << (tinfo.u.rbyd.block % 8);
|
||||
|
||||
} else {
|
||||
// this shouldn't happen
|
||||
@@ -333,23 +332,22 @@ code = '''
|
||||
if (tinfo.tag == LFSR_TAG_MDIR) {
|
||||
printf("traversal: 0x%x mdir 0x{%x,%x}\n",
|
||||
tinfo.tag,
|
||||
tinfo.u.mdir.rbyd.blocks[0],
|
||||
tinfo.u.mdir.rbyd.blocks[1]);
|
||||
tinfo.u.mdir.blocks[0],
|
||||
tinfo.u.mdir.blocks[1]);
|
||||
|
||||
// keep track of seen blocks
|
||||
seen[tinfo.u.mdir.rbyd.blocks[1] / 8]
|
||||
|= 1 << (tinfo.u.mdir.rbyd.blocks[1] % 8);
|
||||
seen[tinfo.u.mdir.rbyd.blocks[0] / 8]
|
||||
|= 1 << (tinfo.u.mdir.rbyd.blocks[0] % 8);
|
||||
seen[tinfo.u.mdir.blocks[1] / 8]
|
||||
|= 1 << (tinfo.u.mdir.blocks[1] % 8);
|
||||
seen[tinfo.u.mdir.blocks[0] / 8]
|
||||
|= 1 << (tinfo.u.mdir.blocks[0] % 8);
|
||||
|
||||
} else if (tinfo.tag == LFSR_TAG_BRANCH) {
|
||||
printf("traversal: 0x%x btree 0x%x.%x\n",
|
||||
tinfo.tag,
|
||||
tinfo.u.rbyd.blocks[0], tinfo.u.rbyd.trunk);
|
||||
tinfo.u.rbyd.block, tinfo.u.rbyd.trunk);
|
||||
|
||||
// keep track of seen blocks
|
||||
seen[tinfo.u.rbyd.blocks[0] / 8]
|
||||
|= 1 << (tinfo.u.rbyd.blocks[0] % 8);
|
||||
seen[tinfo.u.rbyd.block / 8] |= 1 << (tinfo.u.rbyd.block % 8);
|
||||
|
||||
} else if (tinfo.tag == LFSR_TAG_BLOCK) {
|
||||
printf("traversal: 0x%x block 0x%x\n",
|
||||
@@ -480,23 +478,22 @@ code = '''
|
||||
if (tinfo.tag == LFSR_TAG_MDIR) {
|
||||
printf("traversal: 0x%x mdir 0x{%x,%x}\n",
|
||||
tinfo.tag,
|
||||
tinfo.u.mdir.rbyd.blocks[0],
|
||||
tinfo.u.mdir.rbyd.blocks[1]);
|
||||
tinfo.u.mdir.blocks[0],
|
||||
tinfo.u.mdir.blocks[1]);
|
||||
|
||||
// keep track of seen blocks
|
||||
seen[tinfo.u.mdir.rbyd.blocks[1] / 8]
|
||||
|= 1 << (tinfo.u.mdir.rbyd.blocks[1] % 8);
|
||||
seen[tinfo.u.mdir.rbyd.blocks[0] / 8]
|
||||
|= 1 << (tinfo.u.mdir.rbyd.blocks[0] % 8);
|
||||
seen[tinfo.u.mdir.blocks[1] / 8]
|
||||
|= 1 << (tinfo.u.mdir.blocks[1] % 8);
|
||||
seen[tinfo.u.mdir.blocks[0] / 8]
|
||||
|= 1 << (tinfo.u.mdir.blocks[0] % 8);
|
||||
|
||||
} else if (tinfo.tag == LFSR_TAG_BRANCH) {
|
||||
printf("traversal: 0x%x btree 0x%x.%x\n",
|
||||
tinfo.tag,
|
||||
tinfo.u.rbyd.blocks[0], tinfo.u.rbyd.trunk);
|
||||
tinfo.u.rbyd.block, tinfo.u.rbyd.trunk);
|
||||
|
||||
// keep track of seen blocks
|
||||
seen[tinfo.u.rbyd.blocks[0] / 8]
|
||||
|= 1 << (tinfo.u.rbyd.blocks[0] % 8);
|
||||
seen[tinfo.u.rbyd.block / 8] |= 1 << (tinfo.u.rbyd.block % 8);
|
||||
|
||||
} else if (tinfo.tag == LFSR_TAG_BLOCK) {
|
||||
printf("traversal: 0x%x block 0x%x\n",
|
||||
|
||||
Reference in New Issue
Block a user