From 18b6e9b212364b4ce5f00c126327cfde74b6c9bd Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Mon, 3 Nov 2008 01:52:23 +0000 Subject: Spread the amount of time spent in cleanup about 2 minutes --- ot_clean.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ot_clean.c') diff --git a/ot_clean.c b/ot_clean.c index 7ac86a8..4f18433 100644 --- a/ot_clean.c +++ b/ot_clean.c @@ -8,6 +8,7 @@ #include #include #include +#include /* Libowfat */ #include "byte.h" @@ -103,6 +104,11 @@ static void clean_make() { } } mutex_bucket_unlock( bucket ); + + /* We want the cleanup to be spread about 2 Minutes to reduce load spikes + during cleanup. Sleeping around two minutes was chosen to allow enough + time for the actual work and fluctuations in timer. */ + usleep( ( 2 * 60 * 1000000 ) / OT_BUCKET_COUNT ); } } -- cgit v1.2.3