mm: pgtable: remove pte_offset_map_nolock()
authorQi Zheng <zhengqi.arch@bytedance.com>
Thu, 26 Sep 2024 06:46:26 +0000 (14:46 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 6 Nov 2024 00:56:29 +0000 (16:56 -0800)
Now no users are using the pte_offset_map_nolock(), remove it.

Link: https://lkml.kernel.org/r/d04f9bbbcde048fb6ffa6f2bdbc6f9b22d5286f9.1727332572.git.zhengqi.arch@bytedance.com
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Reviewed-by: Muchun Song <muchun.song@linux.dev>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Peter Xu <peterx@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Documentation/mm/split_page_table_lock.rst
include/linux/mm.h
mm/pgtable-generic.c

index 08d0e706a32db0b41e09befd9f4224b902a04db7..581446d4a4ebaffd8308cda0e36383e348ee4705 100644 (file)
@@ -16,9 +16,6 @@ There are helpers to lock/unlock a table and other accessor functions:
  - pte_offset_map_lock()
        maps PTE and takes PTE table lock, returns pointer to PTE with
        pointer to its PTE table lock, or returns NULL if no PTE table;
- - pte_offset_map_nolock()
-       maps PTE, returns pointer to PTE with pointer to its PTE table
-       lock (not taken), or returns NULL if no PTE table;
  - pte_offset_map_ro_nolock()
        maps PTE, returns pointer to PTE with pointer to its PTE table
        lock (not taken), or returns NULL if no PTE table;
index 0cf45d4b72866d2a16e58664065d48feea596799..8f5394d75ce23302a6c5e77bfe5b99c5423a8a88 100644 (file)
@@ -3015,8 +3015,6 @@ static inline pte_t *pte_offset_map_lock(struct mm_struct *mm, pmd_t *pmd,
        return pte;
 }
 
-pte_t *pte_offset_map_nolock(struct mm_struct *mm, pmd_t *pmd,
-                       unsigned long addr, spinlock_t **ptlp);
 pte_t *pte_offset_map_ro_nolock(struct mm_struct *mm, pmd_t *pmd,
                                unsigned long addr, spinlock_t **ptlp);
 pte_t *pte_offset_map_rw_nolock(struct mm_struct *mm, pmd_t *pmd,
index daa08b91ab6b299cfb37adfffe2ac8d77953e6e2..5297dcc38c37a9f96c148690d49e4250b6c5d07a 100644 (file)
@@ -305,18 +305,6 @@ nomap:
        return NULL;
 }
 
-pte_t *pte_offset_map_nolock(struct mm_struct *mm, pmd_t *pmd,
-                            unsigned long addr, spinlock_t **ptlp)
-{
-       pmd_t pmdval;
-       pte_t *pte;
-
-       pte = __pte_offset_map(pmd, addr, &pmdval);
-       if (likely(pte))
-               *ptlp = pte_lockptr(mm, &pmdval);
-       return pte;
-}
-
 pte_t *pte_offset_map_ro_nolock(struct mm_struct *mm, pmd_t *pmd,
                                unsigned long addr, spinlock_t **ptlp)
 {
@@ -372,15 +360,6 @@ pte_t *pte_offset_map_rw_nolock(struct mm_struct *mm, pmd_t *pmd,
  * and disconnected table.  Until pte_unmap(pte) unmaps and rcu_read_unlock()s
  * afterwards.
  *
- * pte_offset_map_nolock(mm, pmd, addr, ptlp), above, is like pte_offset_map();
- * but when successful, it also outputs a pointer to the spinlock in ptlp - as
- * pte_offset_map_lock() does, but in this case without locking it.  This helps
- * the caller to avoid a later pte_lockptr(mm, *pmd), which might by that time
- * act on a changed *pmd: pte_offset_map_nolock() provides the correct spinlock
- * pointer for the page table that it returns.  In principle, the caller should
- * recheck *pmd once the lock is taken; in practice, no callsite needs that -
- * either the mmap_lock for write, or pte_same() check on contents, is enough.
- *
  * pte_offset_map_ro_nolock(mm, pmd, addr, ptlp), above, is like pte_offset_map();
  * but when successful, it also outputs a pointer to the spinlock in ptlp - as
  * pte_offset_map_lock() does, but in this case without locking it.  This helps