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:
@@ -363,7 +363,7 @@ typedef struct lfs_cache {
|
||||
typedef struct lfsr_rbyd {
|
||||
// note this lines up with weight in lfsr_btree_t
|
||||
lfsr_srid_t weight;
|
||||
lfs_block_t blocks[2];
|
||||
lfs_block_t block;
|
||||
// eoff=0, trunk=0 => not yet committed
|
||||
// eoff=0, trunk>0 => not yet fetched
|
||||
// eoff>=block_size => rbyd not erased/needs compaction
|
||||
@@ -388,6 +388,8 @@ typedef struct lfsr_mptr {
|
||||
|
||||
typedef struct lfsr_mdir {
|
||||
lfsr_smid_t mid;
|
||||
// block[0] should always be the active block, block[0]=rbyd.block
|
||||
lfs_block_t blocks[2];
|
||||
lfsr_rbyd_t rbyd;
|
||||
} lfsr_mdir_t;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user