Go to file
Audra Mitchell 52d9b5f0b6 mm/gup: remove the restriction on locked with FOLL_LONGTERM
JIRA: https://issues.redhat.com/browse/RHEL-27739

This patch is a backport of the following upstream commit:
commit 53b2d09bdd12092a7341c08b6b863560db62fa57
Author: Jason Gunthorpe <jgg@ziepe.ca>
Date:   Wed Nov 16 16:07:09 2022 -0400

    mm/gup: remove the restriction on locked with FOLL_LONGTERM

    This restriction was created because FOLL_LONGTERM used to scan the vma
    list, so it could not tolerate becoming unlocked.  That was fixed in
    commit 52650c8b46 ("mm/gup: remove the vma allocation from
    gup_longterm_locked()") and the restriction on !vma was removed.

    However, the locked restriction remained, even though it isn't necessary
    anymore.

    Adjust __gup_longterm_locked() so it can handle the mmap_read_lock()
    becoming unlocked while it is looping for migration.  Migration does not
    require the mmap_read_sem because it is only handling struct pages.  If we
    had to unlock then ensure the whole thing returns unlocked.

    Remove __get_user_pages_remote() and __gup_longterm_unlocked().  These
    cases can now just directly call other functions.

    Link: https://lkml.kernel.org/r/0-v1-b9ae39aa8884+14dbb-gup_longterm_locked_jgg@nvidia.com
    Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
    Reviewed-by: John Hubbard <jhubbard@nvidia.com>
    Cc: Alistair Popple <apopple@nvidia.com>
    Cc: John Hubbard <jhubbard@nvidia.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Signed-off-by: Audra Mitchell <audra@redhat.com>
2024-04-09 09:42:57 -04:00
Documentation
LICENSES
arch
block
certs
crypto
drivers
fs
include
init
io_uring
ipc
kernel
lib
mm mm/gup: remove the restriction on locked with FOLL_LONGTERM 2024-04-09 09:42:57 -04:00
net
redhat
samples
scripts
security
sound
tools
usr
virt
.clang-format
.cocciconfig
.get_maintainer.conf
.get_maintainer.ignore
.gitattributes
.gitignore
.gitlab-ci.yml
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
Kconfig.redhat
MAINTAINERS
Makefile
Makefile.rhelver
README
makefile

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.