Go to file
Audra Mitchell bb4ac080a2 mm/ksm: convert break_ksm() to use walk_page_range_vma()
JIRA: https://issues.redhat.com/browse/RHEL-27739

This patch is a backport of the following upstream commit:
commit d7c0e68dab98f0f5a2af501eaefeb90cc855fc80
Author: David Hildenbrand <david@redhat.com>
Date:   Fri Oct 21 12:11:40 2022 +0200

    mm/ksm: convert break_ksm() to use walk_page_range_vma()

    FOLL_MIGRATION exists only for the purpose of break_ksm(), and actually,
    there is not even the need to wait for the migration to finish, we only
    want to know if we're dealing with a KSM page.

    Using follow_page() just to identify a KSM page overcomplicates GUP code.
    Let's use walk_page_range_vma() instead, because we don't actually care
    about the page itself, we only need to know a single property -- no need
    to even grab a reference.

    So, get rid of follow_page() usage such that we can get rid of
    FOLL_MIGRATION now and eventually be able to get rid of follow_page() in
    the future.

    In my setup (AMD Ryzen 9 3900X), running the KSM selftest to test unmerge
    performance on 2 GiB (taskset 0x8 ./ksm_tests -D -s 2048), this results in
    a performance degradation of ~2% (old: ~5010 MiB/s, new: ~4900 MiB/s).  I
    don't think we particularly care for now.

    Interestingly, the benchmark reduction is due to the single callback.
    Adding a second callback (e.g., pud_entry()) reduces the benchmark by
    another 100-200 MiB/s.

    Link: https://lkml.kernel.org/r/20221021101141.84170-9-david@redhat.com
    Signed-off-by: David Hildenbrand <david@redhat.com>
    Cc: Andrea Arcangeli <aarcange@redhat.com>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Jason Gunthorpe <jgg@nvidia.com>
    Cc: John Hubbard <jhubbard@nvidia.com>
    Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
    Cc: Peter Xu <peterx@redhat.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: Vlastimil Babka <vbabka@suse.cz>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Signed-off-by: Audra Mitchell <audra@redhat.com>
2024-04-09 09:43:01 -04:00
Documentation panic: Expose "warn_count" to sysfs 2024-04-09 09:43:00 -04:00
LICENSES LICENSES/dual/CC-BY-4.0: Git rid of "smart quotes" 2021-07-15 06:31:24 -06:00
arch mm: delay page_remove_rmap() until after the TLB has been flushed 2024-04-09 09:42:56 -04:00
block Merge: block: 9.5 update take 2 2024-03-29 09:44:24 -04:00
certs integrity: PowerVM support for loading third party code signing keys 2024-02-05 19:05:32 +08:00
crypto Merge: crypto: dh - implement FIPS PCT and a panic on a failure 2024-03-20 13:38:07 -03:00
drivers habanalabs: remove FOLL_FORCE usage 2024-04-09 09:42:58 -04:00
fs memory: move hotplug memory notifier priority to same file for easy sorting 2024-04-09 09:42:51 -04:00
include mm/pagewalk: add walk_page_range_vma() 2024-04-09 09:43:01 -04:00
init init: Mark start_kernel() __noreturn 2024-03-20 09:43:02 -04:00
io_uring io_uring: ensure local task_work is run on wait timeout 2024-02-05 16:34:25 -05:00
ipc ipc/shm: use VMA iterator instead of linked list 2024-04-01 11:19:51 -04:00
kernel panic: Expose "warn_count" to sysfs 2024-04-09 09:43:00 -04:00
lib panic: Consolidate open-coded panic_on_warn checks 2024-04-09 09:43:00 -04:00
mm mm/ksm: convert break_ksm() to use walk_page_range_vma() 2024-04-09 09:43:01 -04:00
net Merge: arch/x86: backport 2024-03-26 11:25:15 -04:00
redhat redhat/configs: enable CONFIG_SECRETMEM 2024-04-09 09:42:57 -04:00
samples Merge: BPF: update to 6.6 2024-01-12 13:40:43 -05:00
scripts Merge: block: 9.5 update take 2 2024-03-29 09:44:24 -04:00
security Merge: arch/x86: backport 2024-03-26 11:25:15 -04:00
sound Merge: arch/x86: backport 2024-03-26 11:25:15 -04:00
tools tools/selftets/damon/sysfs: test tried_regions directory existence 2024-04-09 09:42:55 -04:00
usr shmbuf.h: add asm/shmbuf.h to UAPI compile-test coverage 2024-03-20 09:42:28 -04:00
virt KVM: x86: Add support for "protected VMs" that can utilize private memory 2023-12-01 14:51:47 +01:00
.clang-format cpumask: re-introduce constant-sized cpumask optimizations 2024-03-20 09:42:41 -04:00
.cocciconfig
.get_maintainer.conf get_maintainer.conf: Update with new location of RHMAINTAINERS 2022-01-19 14:26:16 -05:00
.get_maintainer.ignore
.gitattributes gitattributes: Remove unnecesary export restrictions 2021-08-30 10:50:35 -04:00
.gitignore kbuild: Cleanup DT Overlay intermediate files as appropriate 2024-03-15 14:47:39 -05:00
.gitlab-ci.yml gitlab-ci: enable arm64/s390x/ppc64le debug builds 2024-02-26 20:21:01 +01:00
.mailmap mailmap: remove my redhat.com address from RHEL9's .mailmap file 2022-09-26 09:34:38 -04:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: Orphan Cadence PCIe IP 2024-02-25 08:39:32 -07:00
Kbuild
Kconfig Introduce CONFIG_RH_DISABLE_DEPRECATED 2021-08-30 10:50:55 -04:00
Kconfig.redhat redhat: kABI: add missing RH_KABI_SIZE_ALIGN_CHECKS Kconfig option 2024-01-12 14:27:16 +01:00
MAINTAINERS Merge: arch/x86: backport 2024-03-26 11:25:15 -04:00
Makefile Merge: arch/x86: backport 2024-03-26 11:25:15 -04:00
Makefile.rhelver [redhat] kernel-5.14.0-435.el9 2024-03-29 10:10:45 -04:00
README
makefile redhat: Change Makefile target names to dist- 2021-08-30 10:50:11 -04: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.