Decay: move in some background_thread accesses.

This commit is contained in:
David Goldblatt
2020-03-09 19:16:34 -07:00
committed by David Goldblatt
parent cdb916ed3f
commit d1d7e1076b
2 changed files with 15 additions and 4 deletions

View File

@@ -105,6 +105,17 @@ decay_epoch_npages_delta(const decay_t *decay) {
return decay->backlog[SMOOTHSTEP_NSTEPS - 1];
}
/*
* Current epoch duration, in nanoseconds. Given that new epochs are started
* somewhat haphazardly, this is not necessarily exactly the time between any
* two calls to decay_maybe_advance_epoch; see the comments on fields in the
* decay_t.
*/
static inline uint64_t
decay_epoch_duration_ns(const decay_t *decay) {
return nstime_ns(&decay->interval);
}
/*
* Returns true if the passed in decay time setting is valid.
* < -1 : invalid