Changes between Version 13 and Version 14 of kernel_locks
- Timestamp:
- Jan 19, 2015, 8:44:53 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
kernel_locks
v13 v14 3 3 [[PageOutline]] 4 4 5 The [source:soft/giet_vm/giet_common/ locks.c locks.c] and [source:soft/giet_vm/giet_common/locks.hlocks.h] files define the functions used by the kernel to take & release locks protecting exclusive access to shared resources.5 The [source:soft/giet_vm/giet_common/kernel_locks.c kernel_locks.c] and [source:soft/giet_vm/giet_common/kernel_locks.h kernel_locks.h] files define the functions used by the kernel to take & release locks protecting exclusive access to shared resources. 6 6 7 The GIET_VM kernel define three types of spin-lock:7 The GIET_VM kernel define three types of locks: 8 8 9 9 1. The '''simple_lock_t''' implements a non-distributed spin-lock without waiting queue. 10 10 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 must be initialised.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. 12 12 13 3. The '''s bt_lock_t''' spin-lock can be used when a single lock protect a unique resource shared by a large number of tasks running on a 2D mesh clusterised architecture. The lock is implemented as a Sliced Binary Tree of ''partial''locks distributed on all cluster, and is intended to avoid contention on a single cluster when all tasks try to access the same resource.13 3. The '''sqt_lock_t''' spin-lock can be used when a single lock protect a unique resource shared by a large number of tasks running on a 2D mesh clusterised architecture. The lock is implemented as a Synchronisation Quad Tree (SQT) of ''partial'' spin_locks distributed on all cluster, and is intended to avoid contention on a single cluster when all tasks try to access the same resource. 14 14 15 15 All the lock access functions are prefixed by "_" to remind that they can only be executed by a processor in kernel mode. … … 49 49 50 50 === void '''_sbt_lock_init'''( sbt_lock_t* lock ) === 51 This function allocates and initialises the S liced Binary Tree, distributed on all clusters. The X_SIZE and Y_SIZE parameters defined in the ''hard_config.h'' file must be power of 2, with X_SIZE = Y_SIZE or X_SIZE = 2 * Y_SIZE. This function use the _remote_malloc() function, and the distributed kernel heap segments.51 This function allocates and initialises the SQT nodes, distributed on all clusters. It computes the smallest SQT covering all processors defined in the mapping. This function use the _remote_malloc() function, and the distributed kernel heap segments. 52 52 53 53 === void '''_sbt_lock_acquire'''( sbt_lock_t* lock ) ===