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 Field Configuration option Description Write lock
211 :c:member:`!anon_name` CONFIG_ANON_VMA_NAME A field for storing a mmap write,
212 :c:struct:`!struct anon_vma_name` VMA write.
222 :c:member:`!vm_policy` CONFIG_NUMA :c:type:`!mempolicy` object which mmap write,
223 describes the NUMA behaviour of the VMA write.
231 :c:member:`!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 :c:member:`!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.
373 If an operation requires exclusive access, a write lock is used, but if not, a
390 detaches VMAs under an mmap write lock before tearing down page tables under a
393 This means such an operation could race with this, and thus an mmap **write**
542 held (read or write), doing so with only rmap locks would be dangerous (see
600 If a write is being performed, or if a read informs whether a write takes place
637 mmap or VMA lock in read or write mode (see the warning in the locking rules
695 Installing entries this way ensures mutual exclusion on write.
704 It is insufficient to simply hold an mmap write lock and VMA lock (which will
713 either the mmap write lock has been taken (as specified by its
754 write has started, then we do not obtain a read lock.
770 VMA **write** locks are acquired via :c:func:`!vma_start_write` in instances where a
772 acquired. An mmap write lock **must** be held for the duration of the VMA write
773 lock, releasing or downgrading the mmap write lock also releases the VMA write
776 Note that when write-locking a VMA lock, the :c:member:`!vma.vm_refcnt` is temporarily
780 This ensures the semantics we require - VMA write locks provide exclusive write
802 Writing requires the mmap to be write-locked and the VMA lock to be acquired via
803 :c:func:`!vma_start_write`, however the write lock is released by the termination or
804 downgrade of the mmap write lock so no :c:func:`!vma_end_write` is required.
807 used in order to reduce complexity, especially for operations which write-lock
811 sequence count :c:member:`!vma->vm_lock_seq` then the VMA is write-locked. If
814 Each time the mmap write lock is released in :c:func:`!mmap_write_unlock` or
819 This way, we ensure that, regardless of the VMA's sequence number, a write lock
820 is never incorrectly indicated and that when we release an mmap write lock we
821 efficiently release **all** VMA write locks contained within the mmap at the
824 Since the mmap write lock is exclusive against others who hold it, the automatic
826 keep VMAs locked across entirely separate write operations. It also maintains
841 On the write side, we set a bit in :c:member:`!vma.vm_refcnt` which can't be
844 the mm. During this entire operation mmap write lock is held.
851 indicate VMA's write-locked state until mmap write lock is dropped or downgraded.
857 mmap write lock downgrading
860 When an mmap write lock is held one has exclusive access to resources within the
861 mmap (with the usual caveats about requiring VMA write locks to avoid races with
864 It is then possible to **downgrade** from a write lock to a read lock via
866 implicitly terminates all VMA write locks via :c:func:`!vma_end_write_all`, but
872 have to acquire a write lock first to downgrade it, and the downgraded lock
873 prevents a new write lock from being obtained until the original lock is
876 For clarity, we map read (R)/downgraded write (D)/write (W) locks against one