Changes between Version 9 and Version 10 of kernel_locks


Ignore:
Timestamp:
Dec 6, 2014, 2:14:05 PM (9 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • kernel_locks

    v9 v10  
    55The [source:soft/giet_vm/giet_common/locks.c locks.c] and [source:soft/giet_vm/giet_common/locks.h locks.h] files define the functions used by the kernel to take & release  locks protecting exclusive access to a shared resource.
    66
    7 The GIET_VM kernel define two types of spin-lock:
    8  * The '''spin_lock_t''' implements a spin-lock with a waiting queue (based on a ticket allocator scheme), to enforce fairness and avoid live-lock situations. The GIET_LOCK_MAX_TICKET define the wrapping value for the ticket allocator.
    9  * The '''simple_lock_t''' implements a spin-lock without waiting queue. It is only used by the TTY0 access functions, to get exclusive access to the TTY0 kernel terminal
     7The GIET_VM kernel define three types of spin-lock:
    108
    11 The lock access functions are prefixed by "_" to remind that they can only be executed by a processor in kernel mode.
     9 1. The '''simple_lock_t''' implements a spin-lock without waiting queue. It is only used by the TTY0 access functions, to get exclusive access to the TTY0 kernel terminal.
    1210
    13 Both the '''spin_lock_t''' and '''simple_lock_t''' structures are implemented to have one single lock in a 64 bytes cache line, and should be aligned on a cache line boundary.
     11 2. The '''spin_lock_t''' implements a spin-lock with a waiting queue (based on a ticket allocator scheme), to enforce fairness and avoid live-lock situations. The GIET_LOCK_MAX_TICKET define the wrapping value for the ticket allocator. This lock
     12must be initialised.
    1413
     14 3. The '''sbt_lock_t''' spin-lock can be used when a single lock protect a unique resource that can be used by any task
     15running on a 2D mesh of clusters. The lock is implemented as a Sliced Binary Tree of ''partial'' locks distributed on all cluster
     16of a 2D mesh. It is intended to avoid contention on a single cluster when all tasks try to access the same lock.
     17
     18All the lock access functions are prefixed by "_" to remind that they can only be executed by a processor in kernel mode.
     19
     20The '''simple_lock_t''', '''sbt_lock_t''', and '''spin_lock_t''' structures are implemented to have one single lock in a 64 bytes cache line, and should be aligned on a cache line boundary.
     21
     22== Atomic access functions ==
    1523
    1624 === unsigned int '''_atomic_increment'''( unsigned int * shared , unsigned int increment ) ===
     
    1927 * '''increment''' : increment value
    2028
     29== Simple lock access functions ==
     30
     31 === void '''_simple_lock_acquire'''( simple_lock_t * lock ) ===
     32This blocking function does not implement any ordered allocation, and is not distributed. It returns only when the lock as been granted.
     33
     34 === void '''_simple_lock_release'''( simple_lock_t * lock ) ===
     35This function releases the lock, and can be used for lock initialisation. It must always be called after a successful _simple_lock_acquire().
     36
     37== Queuing Lock Access functions ==
     38
    2139 === void '''_lock_init'''( spin_lock_t * lock ) ===
    22 This function initializes the spin lock ticket allocator.
     40This function initializes the lock ticket allocator.
    2341
    2442 === void '''_lock_acquire'''( spin_lock_t * lock ) ===
     
    2846This function releases the lock, but cannot be used for lock initialisation. It must always be called after a successful _lock_acquire().
    2947
    30  === void '''_simple_lock_acquire'''( simple_lock_t * lock ) ===
    31 This blocking function does not implement any ordered allocation. It returns only when the lock as been granted.
     48== Distributed Lock Access functions ==
    3249
    33  === void '''_simple_lock_release'''( simple_lock_t * lock ) ===
    34 This function releases the lock, and can be used for lock initialisation. It must always be called after a successful _simple_lock_acquire().
     50 === void '''sbt_lock_init'''( sbt_lock_t*   lock,  unsigned int   ntasks ) ===
     51
     52 === void '''sbt_lock_acquire'''( sbt_lock_t*  lock ) ===
     53
     54 === void '''sbt_lock_release'''( sbt_lock_t*  lock ) ===
     55
     56