Revert "mm/gup: remove try_get_page(), call try_get_compound_head() directly"
Linus Torvalds authored
This reverts commit 9857a17f.

That commit was completely broken, and I should have caught on to it
earlier.  But happily, the kernel test robot noticed the breakage fairly
quickly.

The breakage is because "try_get_page()" is about avoiding the page
reference count overflow case, but is otherwise the exact same as a
plain "get_page()".

In contrast, "try_get_compound_head()" is an entirely different beast,
and uses __page_cache_add_speculative() because it's not just about the
page reference count, but also about possibly racing with the underlying
page going away.

So all the commentary about how

 "try_get_page() has fallen a little behind in terms of maintenance,
  try_get_compound_head() handles speculative page references more
  thoroughly"

was just completely wrong: yes, try_get_compound_head() handles
speculative page references, but the point is that try_get_page() does
not, and must not...
cd1adf1b
Name Last commit Last update
Documentation Merge tag 'trace-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
LICENSES LICENSES/dual/CC-BY-4.0: Git rid of "smart quotes"
arch Revert "mm/gup: remove try_get_page(), call try_get_compound_head() directly"
block Merge tag 'block-5.15-2021-09-05' of git://git.kernel.dk/linux-block
certs certs: Add support for using elliptic curve keys for signing modules
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
drivers thunderbolt: test: split up test cases in tb_test_credit_alloc_all
fs Revert "mm/gup: remove try_get_page(), call try_get_compound_head() directly"
include Revert "mm/gup: remove try_get_page(), call try_get_compound_head() directly"
init Enable '-Werror' by default for all kernel builds
ipc memcg: enable accounting of ipc resources
kernel Merge tag 'trace-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
lib lib/test_scanf: split up number parsing test routines
mm Revert "mm/gup: remove try_get_page(), call try_get_compound_head() directly"
net Merge tag 'nfs-for-5.15-1' of git://git.linux-nfs.org/projects/anna/linux-nfs
samples Merge tag 'vfio-v5.15-rc1' of git://github.com/awilliam/linux-vfio
scripts don't make the syscall checking produce errors from warnings
security Merge tag 'kbuild-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
sound Merge tag 'kbuild-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
tools Merge tag 'perf-tools-for-v5.15-2021-09-04' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
usr .gitignore: prefix local generated files with a slash
virt KVM: Do not leak memory for duplicate debugfs directories
.clang-format clang-format: Update with the latest for_each macro list
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl
.gitattributes .gitattributes: use 'dts' diff driver for dts files
.gitignore .gitignore: ignore only top-level modules.builtin
.mailmap mailmap: update email address of Matthias Fuchs and Thomas Körper
COPYING COPYING: state that all contributions really are covered by this file
CREDITS MAINTAINERS: move Murali Karicheri to credits
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y
Kconfig kbuild: ensure full rebuild when the compiler is updated
MAINTAINERS Merge tag 'misc-5.15-2021-09-05' of git://git.kernel.dk/linux-block
Makefile Enable '-Werror' by default for all kernel builds
README Drop all 00-INDEX files from Documentation/
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.