From eb19c790398a283302a94b12400afe86b91b2bda Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sun, 9 Jan 2022 17:43:18 +0100 Subject: [PATCH] Increase default disk cache to 16 MiB --- HISTORY | 1 + cmdline/io.c | 4 ++-- cmdline/io.h | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/HISTORY b/HISTORY index b3cbd4fd..03581e63 100644 --- a/HISTORY +++ b/HISTORY @@ -4,6 +4,7 @@ SnapRAID HISTORY 12.1 2022/01 ============ * Reduce stack usage to work in enviromnents with limited stack size, like MUSL. + * Increase the default disk cache from 8 MiB to 16 MiB. 12.0 2021/12 ============ diff --git a/cmdline/io.c b/cmdline/io.c index d315304c..3cc77acf 100644 --- a/cmdline/io.c +++ b/cmdline/io.c @@ -879,9 +879,9 @@ void io_init(struct snapraid_io* io, struct snapraid_state* state, #if HAVE_THREAD if (io_cache == 0) { - /* default is 8 MiB of cache */ + /* default is 16 MiB of cache */ /* this seems to be a good tradeoff between speed and memory usage */ - io->io_max = 8 * 1024 * 1024 / state->block_size; + io->io_max = 16 * 1024 * 1024 / state->block_size; if (io->io_max < IO_MIN) io->io_max = IO_MIN; if (io->io_max > IO_MAX) diff --git a/cmdline/io.h b/cmdline/io.h index f0153dcc..685ac97c 100644 --- a/cmdline/io.h +++ b/cmdline/io.h @@ -35,8 +35,8 @@ * 4 - 452 MB/s, CPU 54%, speed 118% * 8 - 487 MB/s, CPU 60%, speed 128% * 16 - 505 MB/s, CPU 63%, speed 132% - * 32 - 520 MB/s, CPU 64%, speed 136% - * 64 - 524 MB/s, CPU 65%, speed 137% + * 32 - 520 MB/s, CPU 64%, speed 136% [SnapRAID <= 12.0] + * 64 - 524 MB/s, CPU 65%, speed 137% [SnapRAID > 12.0] * 128 - 525 MB/s, CPU 66%, speed 138% */ #define IO_MIN 3 /* required by writers, readers can work also with 2 */