/kernel/linux/linux-6.6/include/linux/ |
H A D | rwbase_rt.h | 12 atomic_t readers; member 18 .readers = ATOMIC_INIT(READER_BIAS), \ 25 atomic_set(&(rwbase)->readers, READER_BIAS); \ 31 return atomic_read(&rwb->readers) != READER_BIAS; in rw_base_is_locked() 36 return atomic_read(&rwb->readers) > 0; in rw_base_is_contended()
|
H A D | rwlock_types.h | 59 atomic_t readers; member
|
H A D | pipe_fs_i.h | 46 * @readers: number of current readers of this pipe 69 unsigned int readers; member
|
/kernel/linux/linux-6.6/kernel/locking/ |
H A D | rwbase_rt.c | 8 * 2) Remove the reader BIAS to force readers into the slow path 9 * 3) Wait until all readers have left the critical section 14 * 2) Set the reader BIAS, so readers can use the fast path again 15 * 3) Unlock rtmutex, to release blocked readers 34 * active readers. A blocked writer would force all newly incoming readers 45 * The lock/unlock of readers can run in fast paths: lock and unlock are only 58 * Increment reader count, if sem->readers < 0, i.e. READER_BIAS is in rwbase_read_trylock() 61 for (r = atomic_read(&rwb->readers); r < 0;) { in rwbase_read_trylock() 62 if (likely(atomic_try_cmpxchg_acquire(&rwb->readers, in rwbase_read_trylock() [all...] |
H A D | rwsem.c | 38 * - Bit 0: RWSEM_READER_OWNED - The rwsem is owned by readers 55 * is involved. Ideally we would like to track all the readers that own 109 * 1) rwsem_mark_wake() for readers -- set, clear 296 * The lock is owned by readers when 301 * Having some reader bits set is not enough to guarantee a readers owned 302 * lock as the readers may be in the process of backing out from the count 350 RWSEM_WAKE_READERS, /* Wake readers only */ 362 * Magic number to batch-wakeup waiting readers, even when writers are 409 * Implies rwsem_del_waiter() for all woken readers. 451 * We prefer to do the first reader grant before counting readers in rwsem_mark_wake() 809 int readers = count >> RWSEM_READER_SHIFT; rwsem_rspin_threshold() local [all...] |
/kernel/linux/linux-6.6/fs/btrfs/ |
H A D | locking.c | 115 * - try-lock semantics for readers and writers 325 * if there are pending readers no new writers would be allowed to come in and 331 atomic_set(&lock->readers, 0); in btrfs_drew_lock_init() 340 if (atomic_read(&lock->readers)) in btrfs_drew_try_write_lock() 345 /* Ensure writers count is updated before we check for pending readers */ in btrfs_drew_try_write_lock() 347 if (atomic_read(&lock->readers)) { in btrfs_drew_try_write_lock() 360 wait_event(lock->pending_writers, !atomic_read(&lock->readers)); in btrfs_drew_write_lock() 372 atomic_inc(&lock->readers); in btrfs_drew_read_lock() 391 if (atomic_dec_and_test(&lock->readers)) in btrfs_drew_read_unlock()
|
H A D | subpage.c | 174 atomic_set(&ret->readers, 0); in btrfs_alloc_subpage() 249 atomic_add(nbits, &subpage->readers); in btrfs_subpage_start_reader() 262 ASSERT(atomic_read(&subpage->readers) >= nbits); in btrfs_subpage_end_reader() 263 last = atomic_sub_and_test(nbits, &subpage->readers); in btrfs_subpage_end_reader() 303 ASSERT(atomic_read(&subpage->readers) == 0); in btrfs_subpage_start_writer()
|
H A D | subpage.h | 49 * Both data and metadata needs to track how many readers are for the 51 * Data relies on @readers to unlock the page when last reader finished. 55 atomic_t readers; member
|
H A D | locking.h | 96 * the threads that hold the lock as readers signal the condition for the wait 113 * the condition and do the signaling acquire the lock as readers (shared 197 atomic_t readers; member
|
/kernel/linux/linux-5.10/fs/btrfs/ |
H A D | locking.c | 31 * - try-lock semantics for readers and writers 38 * We want concurrency of many readers and safe updates. The underlying locking 414 * Lock for write. Wait for all blocking and spinning readers and writers. This 593 * if there are pending readers no new writers would be allowed to come in and 605 atomic_set(&lock->readers, 0); in btrfs_drew_lock_init() 620 if (atomic_read(&lock->readers)) in btrfs_drew_try_write_lock() 625 /* Ensure writers count is updated before we check for pending readers */ in btrfs_drew_try_write_lock() 627 if (atomic_read(&lock->readers)) { in btrfs_drew_try_write_lock() 640 wait_event(lock->pending_writers, !atomic_read(&lock->readers)); in btrfs_drew_write_lock() 652 atomic_inc(&lock->readers); in btrfs_drew_read_lock() [all...] |
H A D | locking.h | 135 atomic_t readers; member
|
/kernel/linux/linux-5.10/drivers/misc/ibmasm/ |
H A D | event.c | 30 list_for_each_entry(reader, &sp->event_buffer->readers, node) in wake_up_event_readers() 39 * event readers. 40 * There is no reader marker in the buffer, therefore readers are 73 * Called by event readers (initiated from user space through the file 123 list_add(&reader->node, &sp->event_buffer->readers); in ibmasm_event_reader_register() 153 INIT_LIST_HEAD(&buffer->readers); in ibmasm_event_buffer_init()
|
/kernel/linux/linux-6.6/drivers/misc/ibmasm/ |
H A D | event.c | 30 list_for_each_entry(reader, &sp->event_buffer->readers, node) in wake_up_event_readers() 39 * event readers. 40 * There is no reader marker in the buffer, therefore readers are 73 * Called by event readers (initiated from user space through the file 123 list_add(&reader->node, &sp->event_buffer->readers); in ibmasm_event_reader_register() 153 INIT_LIST_HEAD(&buffer->readers); in ibmasm_event_buffer_init()
|
/kernel/linux/linux-5.10/fs/ |
H A D | pipe.c | 71 * FIFOs and Pipes now generate SIGIO for both readers and writers. 411 !READ_ONCE(pipe->readers); in pipe_writable() 432 if (!pipe->readers) { in pipe_write() 478 if (!pipe->readers) { in pipe_write() 560 * space. We wake up any readers if necessary, and then in pipe_write() 689 if (!pipe->readers) in pipe_poll() 718 pipe->readers--; in pipe_release() 723 if (!pipe->readers != !pipe->writers) { in pipe_release() 884 pipe->readers = pipe->writers = 1; in get_pipe_inode() 1038 * but that requires that we wake up any other readers/writer [all...] |
H A D | splice.c | 194 if (unlikely(!pipe->readers)) { in splice_to_pipe() 237 if (unlikely(!pipe->readers)) { in add_to_pipe() 837 pipe->readers = 1; in splice_direct_to_actor() 987 if (unlikely(!pipe->readers)) { in wait_for_space() 1407 if (!pipe->readers) { in opipe_prep() 1466 if (!opipe->readers) { in splice_pipe_to_pipe() 1553 * If we put data in the output pipe, wakeup any potential readers. in splice_pipe_to_pipe() 1590 if (!opipe->readers) { in link_pipe() 1644 * If we put data in the output pipe, wakeup any potential readers. in link_pipe()
|
/kernel/linux/linux-6.6/fs/ |
H A D | pipe.c | 72 * FIFOs and Pipes now generate SIGIO for both readers and writers. 413 !READ_ONCE(pipe->readers); in pipe_writable() 434 if (!pipe->readers) { in pipe_write() 480 if (!pipe->readers) { in pipe_write() 562 * space. We wake up any readers if necessary, and then in pipe_write() 691 if (!pipe->readers) in pipe_poll() 720 pipe->readers--; in pipe_release() 725 if (!pipe->readers != !pipe->writers) { in pipe_release() 886 pipe->readers = pipe->writers = 1; in get_pipe_inode() 1043 * but that requires that we wake up any other readers/writer [all...] |
/kernel/linux/linux-5.10/drivers/hid/ |
H A D | hid-roccat.c | 18 * It is inspired by hidraw, but uses only one circular buffer for all readers. 47 struct list_head readers; member 48 /* protects modifications of readers list */ 52 * circular_buffer has one writer and multiple readers with their own 191 list_add_tail(&reader->node, &device->readers); in roccat_open() 239 * roccat_report_event() - output data to readers 270 list_for_each_entry(reader, &device->readers, node) { in roccat_report_event() 339 INIT_LIST_HEAD(&device->readers); in roccat_connect()
|
/kernel/linux/linux-5.10/drivers/soc/aspeed/ |
H A D | aspeed-p2a-ctrl.c | 65 u32 readers; member 192 ctrl->readers += 1; in aspeed_p2a_ioctl() 275 priv->parent->readers -= priv->read; in aspeed_p2a_release() 296 /* If parent->readers is zero and open windows is 0, disable the in aspeed_p2a_release() 299 if (!open_regions && priv->parent->readers == 0) in aspeed_p2a_release()
|
/kernel/linux/linux-6.6/drivers/soc/aspeed/ |
H A D | aspeed-p2a-ctrl.c | 65 u32 readers; member 192 ctrl->readers += 1; in aspeed_p2a_ioctl() 275 priv->parent->readers -= priv->read; in aspeed_p2a_release() 296 /* If parent->readers is zero and open windows is 0, disable the in aspeed_p2a_release() 299 if (!open_regions && priv->parent->readers == 0) in aspeed_p2a_release()
|
/kernel/linux/linux-6.6/drivers/hid/ |
H A D | hid-roccat.c | 18 * It is inspired by hidraw, but uses only one circular buffer for all readers. 47 struct list_head readers; member 48 /* protects modifications of readers list */ 52 * circular_buffer has one writer and multiple readers with their own 191 list_add_tail(&reader->node, &device->readers); in roccat_open() 239 * roccat_report_event() - output data to readers 270 list_for_each_entry(reader, &device->readers, node) { in roccat_report_event() 339 INIT_LIST_HEAD(&device->readers); in roccat_connect()
|
/kernel/linux/linux-5.10/drivers/mtd/ubi/ |
H A D | kapi.c | 105 * readers and one writer at a time. 162 vol->readers += 1; in ubi_open_volume() 172 if (vol->exclusive || vol->writers || vol->readers || in ubi_open_volume() 336 vol->readers -= 1; in ubi_close_volume()
|
H A D | cdev.c | 50 users = vol->readers + vol->writers + vol->exclusive + vol->metaonly; in get_exclusive() 56 vol->readers = vol->writers = vol->metaonly = 0; in get_exclusive() 76 ubi_assert(vol->readers == 0 && vol->writers == 0 && vol->metaonly == 0); in revoke_exclusive() 80 vol->readers = 1; in revoke_exclusive()
|
/kernel/linux/linux-6.6/drivers/mtd/ubi/ |
H A D | kapi.c | 106 * readers and one writer at a time. 163 vol->readers += 1; in ubi_open_volume() 173 if (vol->exclusive || vol->writers || vol->readers || in ubi_open_volume() 337 vol->readers -= 1; in ubi_close_volume()
|
/kernel/linux/linux-5.10/include/linux/ |
H A D | pipe_fs_i.h | 46 * @readers: number of current readers of this pipe 69 unsigned int readers; member
|
/kernel/linux/linux-5.10/kernel/locking/ |
H A D | rwsem.c | 36 * - Bit 0: RWSEM_READER_OWNED - The rwsem is owned by readers 42 * bits will be set to disable optimistic spinning by readers and writers. 45 * to acquire the lock via optimistic spinning, but not readers. Similar 59 * is involved. Ideally we would like to track all the readers that own 63 * is short and there aren't that many readers around. It makes readers 70 * 2) There are just too many readers contending the lock causing it to 76 * groups that contain readers that acquire the lock together smaller 85 * acquire the write lock. Similarly, readers that observe the setting 146 * 1) rwsem_mark_wake() for readers 775 int readers = count >> RWSEM_READER_SHIFT; rwsem_rspin_threshold() local [all...] |