From 4354c9617345207978cdd282045ccb89ad69a23b Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Thu, 23 Jun 2022 09:48:41 +0200 Subject: [PATCH] logger: speed up handling of emergency mode --- kernel/mars_trans_logger.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel/mars_trans_logger.c b/kernel/mars_trans_logger.c index 0a26d52f..29cbacc7 100644 --- a/kernel/mars_trans_logger.c +++ b/kernel/mars_trans_logger.c @@ -850,8 +850,10 @@ int trans_logger_ref_get(struct trans_logger_output *output, struct mref_object * Otherwise consistency could be violated for some time. */ while (_congested(brick)) { - // in case of emergency, busy-wait should be acceptable - brick_msleep(HZ / 10); + /* In case of emergency, busy-wait should be acceptable + */ + brick_msleep(1000 / HZ + 1); + cond_resched(); } return _read_ref_get(output, mref_a); } @@ -859,7 +861,8 @@ int trans_logger_ref_get(struct trans_logger_output *output, struct mref_object /* FIXME: THIS IS PROVISIONARY (use event instead) */ while (unlikely(!brick->power.led_on)) { - brick_msleep(HZ / 10); + brick_msleep(1000 / HZ + 1); + cond_resched(); } return _write_ref_get(output, mref_a);