Lines Matching full:semaphore
32 * - multiple semaphore operations that alter the same semaphore in
48 * the per-semaphore array structure.
49 * Thus: Perfect SMP scaling between independent semaphore arrays.
51 * trashing on the semaphore array spinlock will limit the scaling.
61 * - A woken up task may not even touch the semaphore array anymore, it may
64 * semaphore array, lazily allocated). For backwards compatibility, multiple
68 * and per-semaphore list (stored in the array). This allows to achieve FIFO
94 /* One semaphore structure for each semaphore in the system. */
98 * PID of the process that last modified the semaphore. For
107 /* that alter the semaphore */
109 /* that do not alter the semaphore*/
152 struct list_head list_id; /* per semaphore array list:
154 int semid; /* semaphore set identifier */
156 /* one per semaphore */
195 * b) global or semaphore sem_lock() for read/write:
278 * @sma: semaphore array
281 * It must be called prior to dropping the global semaphore array lock.
292 * Move all pending operation back into the per-semaphore in unmerge_queues()
306 * @sma: semaphore array
308 * This function merges all per-semaphore queues into the global queue.
383 * If the request contains only one semaphore operation, and there are
384 * no complex transactions pending, lock only the semaphore involved.
385 * Otherwise, lock the entire semaphore array, since we either have
405 * Only one semaphore affected - try to optimize locking. in sem_lock()
421 * Acquire the per-semaphore lock. in sem_lock()
525 * newary - Create a new semaphore set
630 * perform_atomic_semop[_slow] - Attempt to perform semaphore
632 * @sma: semaphore array
636 * indicated by the semaphore operation (sem_op):
735 * We scan the semaphore set twice, first to ensure that the entire in perform_atomic_semop()
807 * @sma: semaphore array
842 * @sma: semaphore array.
843 * @semnum: semaphore that was modified.
846 * wake_const_ops must be called after a semaphore in a semaphore array
849 * semaphore.
884 * @sma: semaphore array
890 * on the actual changes that were performed on the semaphore array.
900 /* first: the per-semaphore queues, if known */ in do_smart_wakeup_zero()
935 * @sma: semaphore array.
936 * @semnum: semaphore that was modified.
939 * update_queue must be called after a semaphore in a semaphore array
942 * semaphore.
964 /* If we are scanning the single sop, per-semaphore list of in update_queue()
965 * one semaphore and that semaphore is 0, then it is not in update_queue()
968 * be in the per semaphore pending queue, and decrements in update_queue()
999 * @sma: semaphore array
1017 * @sma: semaphore array
1024 * based on the actual changes that were performed on the semaphore array.
1037 /* semaphore array uses the global queue - just process it. */ in do_smart_update()
1053 * semaphore ops won't be able to run: If the in do_smart_update()
1070 * check_qop: Test if a queued operation sleeps on the semaphore semnum
1099 /* The following counts are associated to each semaphore:
1103 * Per definition, a task waits only on the semaphore of the first semop
1121 /* all task on a per-semaphore list sleep on exactly in count_semcnt()
1122 * that semaphore in count_semcnt()
1139 /* Free a semaphore set. freeary() is called with sem_ids.rwsem locked
1140 * as a writer and the spinlock for this semaphore set hold. sem_ids.rwsem
1151 /* Free the existing undo structures for this semaphore set. */ in freeary()
1185 /* Remove the semaphore set from the IDR */ in freeary()
1898 * @semid: semaphore array id
1901 * The size of the undo structure depends on the size of the semaphore
1925 /* step 1: figure out the size of the semaphore array */ in find_alloc_undo()
1947 /* step 3: Acquire the lock on semaphore array */ in find_alloc_undo()
2023 * to have accessed the same semaphore, thus use in __do_semtimedop()
2078 * only a per-semaphore lock is held and it's OK to proceed with the in __do_semtimedop()
2325 * undo structures are not freed when semaphore arrays are destroyed
2414 struct sem *semaphore = &sma->sems[i]; in exit_sem() local
2416 semaphore->semval += un->semadj[i]; in exit_sem()
2418 * Range checks of the new semaphore value, in exit_sem()
2425 * Linux caps the semaphore value, both at 0 in exit_sem()
2430 if (semaphore->semval < 0) in exit_sem()
2431 semaphore->semval = 0; in exit_sem()
2432 if (semaphore->semval > SEMVMX) in exit_sem()
2433 semaphore->semval = SEMVMX; in exit_sem()
2434 ipc_update_pid(&semaphore->sempid, task_tgid(current)); in exit_sem()