Lines Matching full:write

45 * **mmap locks** - Each MM has a read/write semaphore :c:member:`!mmap_lock`
49 as a read/write semaphore in practice. A VMA read lock is obtained via
51 write lock via :c:func:`!vma_start_write` (all VMA write locks are unlocked
52 automatically when the mmap write lock is released). To take a VMA write lock
87 If you want to **write** VMA metadata fields, then things vary depending on the
90 * Obtain an mmap write lock at the MM granularity via :c:func:`!mmap_write_lock` (or a
93 * Obtain a VMA write lock via :c:func:`!vma_start_write` for each VMA you wish to
96 * If you want to be able to write to **any** field, you must also hide the VMA
97 from the reverse mapping by obtaining an **rmap write lock**.
99 VMA locks are special in that you must obtain an mmap **write** lock **first**
100 in order to obtain a VMA **write** lock. A VMA **read** lock however can be
108 means that without a VMA write lock, page faults will run concurrent with
116 mmap lock VMA lock rmap lock Stable? Read? Write most? Write all?
128 another task already holds an mmap write lock and attempts to acquire a VMA
129 write lock that will deadlock on the VMA read lock.
131 All of these locks behave as read/write semaphores in practice, so you can
132 obtain either a read or a write lock for each of these.
134 .. note:: Generally speaking, a read/write semaphore is a class of lock which
135 permits concurrent readers. However a write lock can only be obtained
139 This renders read locks on a read/write semaphore concurrent with other
140 readers and write locks exclusive against all others holding the semaphore.
154 Field Description Write lock
156 :c:member:`!vm_start` Inclusive start virtual address of range mmap write,
157 VMA describes. VMA write,
158 rmap write.
159 :c:member:`!vm_end` Exclusive end virtual address of range mmap write,
160 VMA describes. VMA write,
161 rmap write.
162 :c:member:`!vm_pgoff` Describes the page offset into the file, mmap write,
163 the original page offset within the VMA write,
164 virtual address space (prior to any rmap write.
177 Field Description Write lock
181 :c:member:`!vm_page_prot` Architecture-specific page table mmap write, VMA write.
188 :c:member:`!__vm_flags` Private, writable access to VMA flags mmap write, VMA write.
209 … Configuration option Description Write lock
211 …:`!anon_name` CONFIG_ANON_VMA_NAME A field for storing a mmap write,
212 … :c:struct:`!struct anon_vma_name` VMA write.
222 …:`!vm_policy` CONFIG_NUMA :c:type:`!mempolicy` object which mmap write,
223 … describes the NUMA behaviour of the VMA write.
231 …:`!vm_userfaultfd_ctx` CONFIG_USERFAULTFD Userfaultfd context wrapper object of mmap write,
232 … type :c:type:`!vm_userfaultfd_ctx`, VMA write.
246 Field Description Write lock
248 …c:member:`!shared.rb` A red/black tree node used, if the mmap write, VMA write,
249 mapping is file-backed, to place the VMA i_mmap write.
253 …c:member:`!shared.rb_subtree_last` Metadata used for management of the mmap write, VMA write,
254 interval tree if the VMA is file-backed. i_mmap write.
255 …mber:`!anon_vma_chain` List of pointers to both forked/CoW’d mmap read, anon_vma write.
265 … mmap write, VMA write,
266 anon_vma write.
500 held (read or write), doing so with only rmap locks would be dangerous (see
558 If a write is being performed, or if a read informs whether a write takes place
595 mmap or VMA lock in read or write mode (see the warning in the locking rules
653 Installing entries this way ensures mutual exclusion on write.
662 It is insufficient to simply hold an mmap write lock and VMA lock (which will
671 either the mmap write lock has been taken (as specified by its
712 write has started, then we do not obtain a read lock.
723 VMA **write** locks are acquired via :c:func:`!vma_start_write` in instances where a
725 acquired. An mmap write lock **must** be held for the duration of the VMA write
726 lock, releasing or downgrading the mmap write lock also releases the VMA write
729 Note that a semaphore write lock is not held across a VMA lock. Rather, a
730 sequence number is used for serialisation, and the write semaphore is only
731 acquired at the point of write lock to update this.
733 This ensures the semantics we require - VMA write locks provide exclusive write
741 read/write semaphore and sequence numbers belonging to the containing
755 Writing requires the mmap to be write-locked and the VMA lock to be acquired via
756 :c:func:`!vma_start_write`, however the write lock is released by the termination or
757 downgrade of the mmap write lock so no :c:func:`!vma_end_write` is required.
760 used in order to reduce complexity, especially for operations which write-lock
764 sequence count :c:member:`!vma->vm_lock_seq` then the VMA is write-locked. If
767 Each time the mmap write lock is released in :c:func:`!mmap_write_unlock` or
772 This way, we ensure that, regardless of the VMA's sequence number, a write lock
773 is never incorrectly indicated and that when we release an mmap write lock we
774 efficiently release **all** VMA write locks contained within the mmap at the
777 Since the mmap write lock is exclusive against others who hold it, the automatic
779 keep VMAs locked across entirely separate write operations. It also maintains
783 :c:member:`!vma->vm_lock` read/write semaphore and hold it, while checking that
793 On the write side, we acquire a write lock on the :c:member:`!vma->vm_lock`
794 read/write semaphore, before setting the VMA's sequence number under this lock,
795 also simultaneously holding the mmap write lock.
801 complexity with a long-term held write lock.
803 This clever combination of a read/write semaphore and sequence count allows for
807 mmap write lock downgrading
810 When an mmap write lock is held one has exclusive access to resources within the
811 mmap (with the usual caveats about requiring VMA write locks to avoid races with
814 It is then possible to **downgrade** from a write lock to a read lock via
816 implicitly terminates all VMA write locks via :c:func:`!vma_end_write_all`, but
822 have to acquire a write lock first to downgrade it, and the downgraded lock
823 prevents a new write lock from being obtained until the original lock is
826 For clarity, we map read (R)/downgraded write (D)/write (W) locks against one