Lines Matching defs:to
37 * - undo adjustments at process exit are limited to 0..SEMVMX.
40 * to /proc/sys/kernel/sem.
47 * - most operations do write operations (actually: spin_lock calls) to
55 * Semaphores are actively given to waiting tasks (necessary for FIFO).
59 * - All work is done by the waker, the woken up task does not have to do
68 * and per-semaphore list (stored in the array). This allows to achieve FIFO
151 struct sem_undo_list *ulp; /* back ptr to sem_undo_list */
159 /* sem_undo_list controls shared access to the list of sem_undo structures
181 * to the mode for complex ops is costly. Therefore:
210 * Setting it from non-zero to 0 is a RELEASE, this is ensured by
211 * using smp_store_release(): Immediately after setting it to 0,
215 * Setting it from 0 to non-zero must be ordered with regards to
217 * is inside a spin_lock() and after a write from 0 to non-zero a
223 * Setting it to a result code is a RELEASE, this is ensured by both a
233 * current->state is set to TASK_INTERRUPTIBLE while holding sem_lock().
278 * It must be called prior to dropping the global semaphore array lock.
289 * We will switch back to simple mode.
308 * It is necessary to achieve FIFO ordering for the pending single-sop
343 * Nothing to do, just reset the
344 * counter until we return to simple mode.
359 * Try to leave the mode that disallows simple operations:
383 * multiple semaphores in our own semops, or we need to look at
401 * Only one semaphore affected - try to optimize locking.
435 * sma->sem_perm.lock. Thus we must switch to locking
437 * Unlike in the fast path, there is no need to recheck
448 * Not a false alarm, thus continue to use the global lock
450 * the caller that has set use_global_mode to non-zero.
526 * @params: ptr to the structure that contains key, semflg and nsems
633 * perform_atomic_semop[_slow] - Attempt to perform semaphore
643 * (3) <0 attempting to decrement semval to a value smaller than zero.
745 * We scan the semaphore set twice, first to ensure that the entire
747 * to shared memory and having to undo such changes in order to block
833 /* pending complex alter operations are too difficult to analyse */
852 * decremented to value - thus they won't proceed either.
864 * was set to 0. If complex const operations are pending, wake_const_ops must
867 * The tasks that must be woken up are added to @wake_q. The return code
961 * The tasks that must be woken up are added to @wake_q. The return code
986 * necessary to scan further: simple increments
995 /* Does q->sleeper still need to sleep? */
1023 * sem_otime is replicated to avoid cache line trashing.
1024 * This function sets one instance to the current time.
1043 * do_smart_update() does the required calls to update_queue and wakeup_zero,
1047 * It is safe to perform this call after dropping all locks.
1074 * semaphore ops wont be able to run: If the
1099 * semaphores. This violates SUS, therefore it was changed to the
1101 * Give the administrators a chance to notice that an application
1122 /* The following counts are associated to each semaphore:
1136 /* First: check the simple operations. They are easy to evaluate */
1256 time64_t to = sma->sems[i].sem_otime;
1258 if (to > res) {
1259 res = to;
1633 * to be held in write mode.
1885 * portions of this code fail, there is no need to free the sem_undo_list.
2083 * to have accessed the same semaphore, thus use
2138 * only a per-semaphore lock is held and it's OK to proceed with the
2188 * We need to sleep on this operation, so we put the current
2189 * task into the pending queue and go to sleep.
2238 * not, from the syscall pov, is quite irrelevant to us at this
2275 * If an interrupt occurred we have to clean up the queue.
2363 * add semadj values to semaphores, free undo structures.
2367 * set of adjustments that needs to be done should be done in an atomic
2368 * manner or not. That is, if we are attempting to decrement the semval
2370 * The original implementation attempted to do this (queue and wait).
2372 * and SVID should be consulted to determine what behavior is mandated.
2414 /* exit_sem raced with IPC_RMID, nothing to do */
2421 /* exit_sem raced with IPC_RMID, nothing to do */
2428 /* exit_sem raced with IPC_RMID, nothing to do */
2437 * exactly the same semid. Nothing to do.
2501 * In order to stay compatible with sem_lock(), we must