From 701b0e67e109a95387f782941ed4cfadbf10f7e9 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Fri, 24 Nov 2017 20:52:05 +0100 Subject: [PATCH] Change the default advise mode to "discard" This avoids to swap out other process memory. --- HISTORY | 3 +++ cmdline/state.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/HISTORY b/HISTORY index e8b09603..8f6a45b9 100644 --- a/HISTORY +++ b/HISTORY @@ -10,6 +10,9 @@ SnapRAID HISTORY * More efficient 'pool' command that updates only the links that need to be updated. This ensures that no change is done, avoiding to trigger a directory rescan of other programs. + * In Linux use by default the advise "discard" mode instead of "flush". + This avoids to swap-out the other process memory, leaving the system + more responsive. * Changed the --test-io-stats screen to print the file name in process for each disk. diff --git a/cmdline/state.c b/cmdline/state.c index a1a922b0..cff523ee 100644 --- a/cmdline/state.c +++ b/cmdline/state.c @@ -538,7 +538,7 @@ void state_config(struct snapraid_state* state, const char* path, const char* co state->file_mode = state->opt.file_mode; } else { /* default mode, if nothing is specified */ - state->file_mode = ADVISE_FLUSH; + state->file_mode = ADVISE_DISCARD; } /* store current command */