summaryrefslogtreecommitdiff
path: root/kern/llsync.c
AgeCommit message (Collapse)Author
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-08-06Fix dependencies on percpu_setupRichard Braun
2017-07-13Switch to initialization operationsRichard Braun
2017-07-02kern/llsync: set ready on first registrationRichard Braun
Processor registration assumes no deferred work could be queued before, which may not be true at boot time, after initializing the llsync module but before starting the scheduler.
2017-06-22kern/macros: move the __read_mostly macro hereRichard Braun
2017-06-10Use log functions where appropriateRichard Braun
2017-05-30Move assert.h to the include directoryRichard Braun
This turns assert.h into a standard header.
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-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-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-26kern/{llsync,rdxtree}: don't use llsync until it's readyRichard Braun
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-09kern/llsync: fix initialization of per-CPU dataRichard Braun
2014-09-05kern/llsync: use percpu variablesRichard Braun
2014-06-11kern/llsync: per-processor deferred work queuesRichard Braun
2014-06-10kern/llsync: rework lockless synchronizationRichard Braun
Use a global checkpoint identifier as a generation counter and remove reset interrupts. For some reason I can't remember, using reset interrupts was thought to be more efficient, perhaps because accessing a global variable on each checkpoint looked expensive. But it's really not scalable, and a read-mostly global variable can get cached locally and not incur expensive access. In addition, add a decent amount of documentation about the semantics with regard to the rest of the system. Explicitely state that checkpoints are triggered by context switches and that it's not allowed to block inside read-side critical sections. Make periodic events attempt to trigger checkpoints too. Add a thread-local read-side critical section nesting counter so that it can be reliably determined whether the processor is running a read-side critical section or not.
2014-06-10kern/llsync: minor changeRichard Braun
Remove trailing space character.
2014-05-22kern/llsync: track reset eventsRichard Braun
2014-05-22kern/llsync: declare llsync_setup as an init functionRichard Braun
2014-05-21kern/llsync: fix header inclusionRichard Braun
2013-06-03kern/llsync: use the work module for deferred processingRichard Braun
This change slightly affects the interface by making users directly pass work objects.
2013-06-01kern/thread: update creation attributes handlingRichard Braun
Make passing attributes and passing a thread name mandatory.
2013-05-25kern/llsync: replace raw bitmaps with cpumapsRichard Braun
2013-05-24kern/llsync: group related functionsRichard Braun
This minor change groups the reset/commit and register/unregister functions together for better discoverability.
2013-05-24kern/llsync: fix checkpoint reset interrupt handlingRichard Braun
This change makes reset requests write both the per-processor flag as well as the checkpoint bitmap atomically, and adjusts the module logic accordingly. It fixes a race between checkpoint reset and system timer interrupts where the timer interrupt would make the local processor commit its checkpoint although it can't be reliably determined that it reached a checkpoint since the last global checkpoint, because the reset interrupt wasn't received yet. This problem would rarely happen on real hardware because of the near-instant handling of IPIs, but it was observed on virtual machines.
2013-05-24kern/llsync: fix first processor registrationRichard Braun
Intuitively, registering the first processor should trigger a global checkpoint to get the lockless synchronization system started. It is possible, however, that this case occurs frequently on idle systems, where processors are normally not registered, and only perform load balancing. It can also happen that a processor determines itself as the only registered one whereas reset interrupts have not yet been processed, in which case a global checkpoint should just not occur. The real condition for a global checkpoint is the number of pending checkpoints reaching 0.
2013-05-24kern/llsync: minor refactoringRichard Braun
Move code handling the unregistration of the last processor in the global checkpoint processing function, where list management actually occurs.
2013-05-24kern/llsync: disable interrupts on per-CPU data accessRichard Braun
Not strictly required, but makes things simpler at virtually no cost.
2013-05-24kern/llsync: assume interrupts are disabled on commitRichard Braun
2013-05-24kern/llsync: improve concurrencyRichard Braun
Keep a local copy of a processor registration state to avoid acquiring the global lock when attempting to commit a checkpoint from an unregistered processor.
2013-05-24kern/llsync: fix deadlockRichard Braun
2013-05-24kern/llsync: set worker thread processor affinityRichard Braun
2013-05-15kern/llsync: new moduleRichard Braun
This module provides lockless synchronization so that reads can safely occur during updates, without holding a lock. It is based on passive serialization as described in US patent 4809168, and achieves a goal similar to Linux RCU (Read-Copy Update).