summaryrefslogtreecommitdiff
path: root/kern/sref.c
AgeCommit message (Collapse)Author
2018-02-24New errno.h standard headerRichard Braun
Use standard errno codes. This change also adds strerror to string.h.
2018-02-20Rework the initialization operations of some kernel modulesRichard Braun
In order to avoid workarounds that check whether a module is ready or not, break the initialization of some core modules into a bootstrap step for basic BSP initialization, and a setup step that completes initialization. Most users only need the bootstrap operation as a dependency, especially since scheduling isn't enabled yet.
2018-02-07kern/sref: allow custom initial valuesRichard Braun
2018-02-07kern/sref: allow usage from interrupt contextRichard Braun
2018-01-12kern/sref: relax memory ordering on weak reference operationsRichard Braun
2018-01-10kern/sref: minor style updatesRichard Braun
2018-01-10kern/sref: flip queues on epoch endRichard Braun
Make epoch management slightly faster by replacing the "cascading" of queue0 into queue1 with queue flipping.
2018-01-10kern/sref: optimize cache flushingRichard Braun
Track valid deltas in a list instead of walking the entire hash table.
2018-01-10kern/sref: use an slist for review queuesRichard Braun
2018-01-10kern/sref: rework delta cache synchronizationRichard Braun
Instead of using a mutex, disable preemption when accessing a delta cache, but reenable it when flushing a cache to keep latencies low.
2017-12-03Revert "Make assert have no side effects"Richard Braun
This reverts commit d18d0e85596f90e0bd597b33d58209d0b3973c95.
2017-10-04Fix some header inclusionsRichard Braun
2017-09-06Use new thread_check_intr_context function consistentlyRichard Braun
2017-09-02kern/thread: new preemption control macrosRichard Braun
These new macros take care of disabling/restoring interrupts in the appropriate order.
2017-09-02Make assert have no side effectsRichard Braun
This makes sure symbols referenced by assert uses may not be generated if unused. The recently introduced __unused macro is used to suppress compiler warnings resulting from this change.
2017-08-06Fix dependencies on percpu_setupRichard Braun
2017-07-25kern/sref: improve sref_weakref_trygetRichard Braun
2017-07-13Switch to initialization operationsRichard Braun
2017-07-02kern/sref: add TODO to review sref_weakref_trygetRichard Braun
2017-06-25Remove the param moduleRichard Braun
Move the page properties into the new x86/page module, and the virtual memory layout macros into the x86/pmap module.
2017-06-13Various atomic access fixesRichard Braun
2017-06-10Use log functions where appropriateRichard Braun
2017-06-03kern/thread: improve thread_wakeup robustnessRichard Braun
2017-05-30Move assert.h to the include directoryRichard Braun
This turns assert.h into a standard header.
2017-05-09Replace sequential consistency with more efficient ordersAgustina Arzille
2017-04-29New stdio.h standard headerRichard Braun
Make kernel code obtain definitions for the printf family of functions through the inclusion of the standard stdio.h header.
2017-04-29kern/printk: rename to printfRichard Braun
The printk functions are close enough to the printf ones to bear the same names.
2017-04-04Use the new atomic operations interfaceAgustina Arzille
Stick to a sequentially consistent model for most atomic operations as it matches the semantics of the existing code. Each call site will have to be reevaluated in order to switch to more relaxed accesses where possible.
2017-03-16Update system counter namesRichard Braun
Now that event counters have been replaced with system counters, drop the convention of naming the counter as the event it tracks.
2017-03-15kern/syscnt: replace the evcnt moduleRichard Braun
The syscnt module supports more generic counters, in addition to atomic access from any context on any architecture.
2017-03-14kern/sref: make manager threads use a high fair-scheduling priorityRichard Braun
2017-02-08kern/thread: add wait channelsRichard Braun
2017-02-04Clean up compilationRichard Braun
Instead of mixing standard headers and internal redefinitions of standard types, completely rely on the compiler for what is guaranteed for a free standing environment. This results in the removal of kern/stddef.h and kern/stdint.h. The kern/types.h header is reintroduced for the different (and saner) purpose of defining types not specified in standard C, namely ssize_t for now.
2017-01-25kern/sref: add a couple of TODOsRichard Braun
2017-01-25kern/sref: implement weak referencesRichard Braun
2017-01-24kern/thread: add the THREAD_KERNEL_PREFIX macroRichard Braun
This macro is used to build kernel thread names.
2017-01-13Replace unsigned long with uintptr_t for integer/pointer conversionsRichard Braun
This is mostly done for the machine-independent part.
2016-12-09Force brackets around one-line conditional statementsRichard Braun
This change was done using astyle, with a few manual editing here and there.
2014-09-25kern/sref: don't inline sref_counter_initRichard Braun
2014-09-24kern/sref: cosmetic changeRichard Braun
2014-09-23kern/sref: fix handling of dirty zero deltasRichard Braun
There is a subtle error in the Refcache pseudocode : flush(): evict all non-zero local cache entries and clear cache update the current epoch Here is a use case demonstrating the issue : take the sref_dirty_zeroes test module on a machine with two processors. The test code makes sure the counter is incremented before being decremented through the use of a condition variable, which also guarantees strong memory ordering, but these operations can occur on any processor. Flushes can occur in any order. EVENT DELTA/0 DELTA/1 GLOBAL start 0 0 1 inc/0 1 1 dec/1 -1 1 flush/1 0 0 inc/1 1 0 dec/0 0 0 flush/0 0 0 end_of_epoch 0 <- first epoch inc/0 1 0 dec/1 0 0 flush/1 0 0 <- flushing 0 inc/1 1 0 dec/0 0 0 flush/0 0 0 <- flushing 0 end_of_epoch 0 <- second epoch Here, deltas are zero on both flushes during the second epoch, leading the implementation to determine that the counter is a true zero. Fix the error by unconditionally flushing valid deltas, even if zero, and actually clearing the cache.
2014-09-23kern/sref: fix handling of dirty zeroes on reviewRichard Braun
2014-09-20kern/sref: new moduleRichard Braun
This module provides multiprocessor scalable reference counters, based on Refcache, as described in the RadixVM paper.