Introduced coalesce_size and crystallize_size, deduplicated test cfg

- coalesce_size - The amount of data allowed to coalesce into single
  data entries.

- crystallize_size - How much data is allowed to be written to btree
  inner nodes before needing to be compacted into a block.

Also deduplicated the test config is something I've been wanting to do
for a while. It doesn't make sense to need to modify several different
instantiations of lfs_config every time a config option is added or
removed...
This commit is contained in:
Christopher Haster
2023-09-24 02:22:19 -05:00
parent 2b950bb16b
commit dc8dce8f0c
6 changed files with 79 additions and 107 deletions
+30 -10
View File
@@ -98,7 +98,7 @@ intmax_t bench_define(size_t define);
// a few preconfigured defines that control how benches run
#define BENCH_IMPLICIT_DEFINE_COUNT 14
#define BENCH_IMPLICIT_DEFINE_COUNT 15
#define BENCH_GEOMETRY_DEFINE_COUNT 3
#define READ_SIZE_i 0
@@ -108,13 +108,14 @@ intmax_t bench_define(size_t define);
#define DISK_SIZE_i 4
#define CACHE_SIZE_i 5
#define INLINE_SIZE_i 6
#define BUD_SIZE_i 7
#define LOOKAHEAD_SIZE_i 8
#define BLOCK_CYCLES_i 9
#define ERASE_VALUE_i 10
#define ERASE_CYCLES_i 11
#define BADBLOCK_BEHAVIOR_i 12
#define POWERLOSS_BEHAVIOR_i 13
#define COALESCE_SIZE_i 7
#define CRYSTALLIZE_SIZE_i 8
#define LOOKAHEAD_SIZE_i 9
#define BLOCK_CYCLES_i 10
#define ERASE_VALUE_i 11
#define ERASE_CYCLES_i 12
#define BADBLOCK_BEHAVIOR_i 13
#define POWERLOSS_BEHAVIOR_i 14
#define READ_SIZE bench_define(READ_SIZE_i)
#define PROG_SIZE bench_define(PROG_SIZE_i)
@@ -123,7 +124,8 @@ intmax_t bench_define(size_t define);
#define DISK_SIZE bench_define(DISK_SIZE_i)
#define CACHE_SIZE bench_define(CACHE_SIZE_i)
#define INLINE_SIZE bench_define(INLINE_SIZE_i)
#define BUD_SIZE bench_define(BUD_SIZE_i)
#define COALESCE_SIZE bench_define(COALESCE_SIZE_i)
#define CRYSTALLIZE_SIZE bench_define(CRYSTALLIZE_SIZE_i)
#define LOOKAHEAD_SIZE bench_define(LOOKAHEAD_SIZE_i)
#define BLOCK_CYCLES bench_define(BLOCK_CYCLES_i)
#define ERASE_VALUE bench_define(ERASE_VALUE_i)
@@ -140,7 +142,8 @@ intmax_t bench_define(size_t define);
BENCH_DEF(DISK_SIZE, 1024*1024 ) \
BENCH_DEF(CACHE_SIZE, lfs_max(16, lfs_max(READ_SIZE, PROG_SIZE))) \
BENCH_DEF(INLINE_SIZE, BLOCK_SIZE/8 ) \
BENCH_DEF(BUD_SIZE, BLOCK_SIZE/4 ) \
BENCH_DEF(COALESCE_SIZE, CACHE_SIZE ) \
BENCH_DEF(CRYSTALLIZE_SIZE, BLOCK_SIZE/4 ) \
BENCH_DEF(LOOKAHEAD_SIZE, 16 ) \
BENCH_DEF(BLOCK_CYCLES, -1 ) \
BENCH_DEF(ERASE_VALUE, 0xff ) \
@@ -156,5 +159,22 @@ intmax_t bench_define(size_t define);
BENCH_GEO("nor", 1, 1, 4096 ) \
BENCH_GEO("nand", 4096, 4096, 32768 )
#define BENCH_CFG \
.read_size = READ_SIZE, \
.prog_size = PROG_SIZE, \
.block_size = BLOCK_SIZE, \
.block_count = BLOCK_COUNT, \
.block_cycles = BLOCK_CYCLES, \
.cache_size = CACHE_SIZE, \
.inline_size = INLINE_SIZE, \
.coalesce_size = COALESCE_SIZE, \
.crystallize_size = CRYSTALLIZE_SIZE, \
.lookahead_size = LOOKAHEAD_SIZE,
#define BENCH_BDCFG \
.erase_value = ERASE_VALUE, \
.erase_cycles = ERASE_CYCLES, \
.badblock_behavior = BADBLOCK_BEHAVIOR,
#endif