Linux kernel source tree
Go to file
Peter Xu 9c67a20704 mm/hugetlb: introduce hugetlb_walk()
huge_pte_offset() is the main walker function for hugetlb pgtables.  The
name is not really representing what it does, though.

Instead of renaming it, introduce a wrapper function called hugetlb_walk()
which will use huge_pte_offset() inside.  Assert on the locks when walking
the pgtable.

Note, the vma lock assertion will be a no-op for private mappings.

Document the last special case in the page_vma_mapped_walk() path where we
don't need any more lock to call hugetlb_walk().

Taking vma lock there is not needed because either: (1) potential callers
of hugetlb pvmw holds i_mmap_rwsem already (from one rmap_walk()), or (2)
the caller will not walk a hugetlb vma at all so the hugetlb code path not
reachable (e.g.  in ksm or uprobe paths).

It's slightly implicit for future page_vma_mapped_walk() callers on that
lock requirement.  But anyway, when one day this rule breaks, one will get
a straightforward warning in hugetlb_walk() with lockdep, then there'll be
a way out.

[akpm@linux-foundation.org: coding-style cleanups]
Link: https://lkml.kernel.org/r/20221216155229.2043750-1-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: James Houghton <jthoughton@google.com>
Cc: Jann Horn <jannh@google.com>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Nadav Amit <nadav.amit@gmail.com>
Cc: Rik van Riel <riel@surriel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-01-18 17:12:39 -08:00
arch mm/uffd: always wr-protect pte in pte|pmd_mkuffd_wp() 2023-01-18 17:12:37 -08:00
block block-6.2-2023-01-13 2023-01-13 17:41:19 -06:00
certs
crypto
Documentation Sync with v6.2-rc4 2023-01-18 16:52:20 -08:00
drivers - Fix the EDAC device's confusion in the polling setting units 2023-01-15 07:12:58 -06:00
fs mm/hugetlb: introduce hugetlb_walk() 2023-01-18 17:12:39 -08:00
include mm/hugetlb: introduce hugetlb_walk() 2023-01-18 17:12:39 -08:00
init Sync with v6.2-rc4 2023-01-18 16:52:20 -08:00
io_uring io_uring: lock overflowing for IOPOLL 2023-01-13 07:32:46 -07:00
ipc
kernel mm/memfd: add MFD_NOEXEC_SEAL and MFD_EXEC 2023-01-18 17:12:37 -08:00
lib Sync with v6.2-rc4 2023-01-18 16:52:20 -08:00
LICENSES
mm mm/hugetlb: introduce hugetlb_walk() 2023-01-18 17:12:39 -08:00
net
rust
samples
scripts kernel hardening fixes for v6.2-rc4 2023-01-14 10:04:00 -06:00
security
sound sound fixes for 6.2-rc4 2023-01-13 08:20:29 -06:00
tools selftests/memfd: add tests for MFD_NOEXEC_SEAL MFD_EXEC 2023-01-18 17:12:37 -08:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap Sync with v6.2-rc4 2023-01-18 16:52:20 -08:00
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS Sync with v6.2-rc4 2023-01-18 16:52:20 -08:00
Makefile Linux 6.2-rc4 2023-01-15 09:22:43 -06:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.