Skip to content

Commit 8651a13

Browse files
lorenzo-stoakesakpm00
authored andcommitted
mm: update mmap_sem comments to refer to mmap_lock
The rename from mm->mmap_sem to mm->mmap_lock was performed in commit da1c55f ("mmap locking API: rename mmap_sem to mmap_lock") and commit c1e8d7c ("map locking API: convert mmap_sem comments"), however some incorrect comments remain. This patch simply corrects those comments which are obviously incorrect within mm itself. Link: https://lkml.kernel.org/r/33fba04389ab63fc4980e7ba5442f521df6dc657.1673048927.git.lstoakes@gmail.com Signed-off-by: Lorenzo Stoakes <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Mike Kravetz <[email protected]> Cc: Muchun Song <[email protected]> Cc: Vlastimil Babka <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 0411d6e commit 8651a13

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

include/linux/mm_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ struct vm_area_struct {
581581
/*
582582
* For private and shared anonymous mappings, a pointer to a null
583583
* terminated string containing the name given to the vma, or NULL if
584-
* unnamed. Serialized by mmap_sem. Use anon_vma_name to access.
584+
* unnamed. Serialized by mmap_lock. Use anon_vma_name to access.
585585
*/
586586
struct anon_vma_name *anon_name;
587587
#endif

include/linux/page_ref.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ static inline bool folio_ref_try_add_rcu(struct folio *folio, int count)
301301
*
302302
* You can also use this function if you're holding a lock that prevents
303303
* pages being frozen & removed; eg the i_pages lock for the page cache
304-
* or the mmap_sem or page table lock for page tables. In this case,
304+
* or the mmap_lock or page table lock for page tables. In this case,
305305
* it will always succeed, and you could have used a plain folio_get(),
306306
* but it's sometimes more convenient to have a common function called
307307
* from both locked and RCU-protected contexts.

mm/hugetlb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ void hugetlb_dup_vma_private(struct vm_area_struct *vma)
11831183

11841184
/*
11851185
* Reset and decrement one ref on hugepage private reservation.
1186-
* Called with mm->mmap_sem writer semaphore held.
1186+
* Called with mm->mmap_lock writer semaphore held.
11871187
* This function should be only used by move_vma() and operate on
11881188
* same sized vma. It should never come here with last ref on the
11891189
* reservation.
@@ -5152,7 +5152,7 @@ static void move_huge_pte(struct vm_area_struct *vma, unsigned long old_addr,
51525152

51535153
/*
51545154
* We don't have to worry about the ordering of src and dst ptlocks
5155-
* because exclusive mmap_sem (or the i_mmap_lock) prevents deadlock.
5155+
* because exclusive mmap_lock (or the i_mmap_lock) prevents deadlock.
51565156
*/
51575157
if (src_ptl != dst_ptl)
51585158
spin_lock_nested(src_ptl, SINGLE_DEPTH_NESTING);

mm/madvise.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static int replace_anon_vma_name(struct vm_area_struct *vma,
130130
#endif /* CONFIG_ANON_VMA_NAME */
131131
/*
132132
* Update the vm_flags on region of a vma, splitting it or merging it as
133-
* necessary. Must be called with mmap_sem held for writing;
133+
* necessary. Must be called with mmap_lock held for writing;
134134
* Caller should ensure anon_name stability by raising its refcount even when
135135
* anon_name belongs to a valid vma because this function might free that vma.
136136
*/

mm/mmap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2294,7 +2294,7 @@ static inline int munmap_sidetree(struct vm_area_struct *vma,
22942294
* @start: The aligned start address to munmap.
22952295
* @end: The aligned end address to munmap.
22962296
* @uf: The userfaultfd list_head
2297-
* @downgrade: Set to true to attempt a write downgrade of the mmap_sem
2297+
* @downgrade: Set to true to attempt a write downgrade of the mmap_lock
22982298
*
22992299
* If @downgrade is true, check return code for potential release of the lock.
23002300
*/
@@ -2469,7 +2469,7 @@ do_mas_align_munmap(struct ma_state *mas, struct vm_area_struct *vma,
24692469
* @len: The length of the range to munmap
24702470
* @uf: The userfaultfd list_head
24712471
* @downgrade: set to true if the user wants to attempt to write_downgrade the
2472-
* mmap_sem
2472+
* mmap_lock
24732473
*
24742474
* This function takes a @mas that is either pointing to the previous VMA or set
24752475
* to MA_START and sets it up to remove the mapping(s). The @len will be

0 commit comments

Comments
 (0)