summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-04-14 23:58:49 +0200
committerRichard Braun <rbraun@sceen.net>2018-04-14 23:58:49 +0200
commit12c41b0aab1e590a9f96f13df9796eff6004d233 (patch)
treedb9f31ea419ed92f16dea797b88d603aba1dd840
parent32a436158554923171d5c2bf7e160290e008436a (diff)
kern/rcu: make the window check interval configurable
-rw-r--r--kern/Kconfig14
-rw-r--r--kern/rcu.c6
2 files changed, 17 insertions, 3 deletions
diff --git a/kern/Kconfig b/kern/Kconfig
index 8125f94..fced67c 100644
--- a/kern/Kconfig
+++ b/kern/Kconfig
@@ -63,6 +63,20 @@ config MUTEX_PLAIN
endchoice
+config RCU_WINDOW_CHECK_INTERVAL
+ int "Interval between RCU window checks"
+ range 1 100
+ default 10
+ ---help---
+ Time (in milliseconds) between two RCU window checks.
+
+ The RCU system keeps memory used by read-side critical sections
+ until it is safe to release it, which can only be determined when
+ checking windows. As a result, checking windows more frequently
+ may help lower latencies on synchronous RCU waits, and in turn,
+ the amount of memory pending release, at the cost of increased
+ CPU overhead.
+
config SHELL
bool "Embedded shell"
default n
diff --git a/kern/rcu.c b/kern/rcu.c
index 1903dcf..834a99b 100644
--- a/kern/rcu.c
+++ b/kern/rcu.c
@@ -105,12 +105,12 @@
#define RCU_WINDOW_ID_INIT_VALUE ((unsigned int)-500)
/*
- * Interval between window checking.
+ * Interval (in milliseconds) between window checking.
*
* When windows are checked, a flip occurs if the previous window isn't
* active any more.
*/
-#define RCU_WINDOW_CHECK_INTERVAL_MS 10
+#define RCU_WINDOW_CHECK_INTERVAL CONFIG_RCU_WINDOW_CHECK_INTERVAL
/*
* Grace period states.
@@ -376,7 +376,7 @@ rcu_data_schedule_timer(struct rcu_data *data, uint64_t now)
{
uint64_t ticks;
- ticks = clock_ticks_from_ms(RCU_WINDOW_CHECK_INTERVAL_MS);
+ ticks = clock_ticks_from_ms(RCU_WINDOW_CHECK_INTERVAL);
timer_schedule(&data->timer, now + ticks);
}