main: fix sync starvation

Commit e20800c47c did too much:
replay may take total preference when there is a permanent
write load.

Only prefer replay when there are multiple logfiles.
This commit is contained in:
Thomas Schoebel-Theuer 2021-02-01 22:53:57 +01:00
parent a77b8d1190
commit 8a04c4cbae
1 changed files with 4 additions and 4 deletions

View File

@ -6318,19 +6318,19 @@ static int make_sync(struct mars_dent *dent)
if (do_start && rot->replay_mode && rot->end_pos > rot->start_pos &&
mars_sync_flip_interval >= 8) {
if (!rot->flip_start) {
/* Give replay a fair chance to jump in, even when
/* Give replay a chance to jump in, e.g. when
* multiple logrotates are necessary, or when
* logfiles are damaged, etc.
* Exception: the current logfile cannot be freed
* anyway.
*/
if (!rot->next_relevant_log ||
rot->flip_round++ > 3) {
rot->flip_round++ > 0) {
rot->flip_start = jiffies;
rot->flip_round = 0;
} else {
do_start = false;
}
do_start = false;
mars_trigger();
} else if ((long long)jiffies - rot->flip_start > mars_sync_flip_interval * HZ &&
rot->sync_brick &&
rot->sync_brick->power.led_on &&