diff options
author | Richard Braun <rbraun@sceen.net> | 2018-01-09 22:59:46 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2018-01-10 22:47:21 +0100 |
commit | 8168a2ba783cfd3d24b201e619d29c92d6621a1e (patch) | |
tree | d6ae40f9644bc7def778e711fc3ef9ee4443fd44 /kern/sref.h | |
parent | b581932dc246de422388e114944b626a2e18ef86 (diff) |
kern/sref: rework delta cache synchronization
Instead of using a mutex, disable preemption when accessing a delta cache,
but reenable it when flushing a cache to keep latencies low.
Diffstat (limited to 'kern/sref.h')
-rw-r--r-- | kern/sref.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kern/sref.h b/kern/sref.h index 5299b9d2..768f1eea 100644 --- a/kern/sref.h +++ b/kern/sref.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2017 Richard Braun. + * Copyright (c) 2014-2018 Richard Braun. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -86,6 +86,8 @@ void sref_counter_init(struct sref_counter *counter, /* * Counter operations. + * + * These functions may safely be called with preemption disabled. */ void sref_counter_inc(struct sref_counter *counter); void sref_counter_dec(struct sref_counter *counter); @@ -95,6 +97,8 @@ void sref_counter_dec(struct sref_counter *counter); * * If successful, increment the reference counter before returning it. * Otherwise return NULL. + * + * This function may safely be called with preemption disabled. */ struct sref_counter * sref_weakref_get(struct sref_weakref *weakref); |