S9 & S9+ & Note 9 kernel source with linux-stable merged in ..................................................................................... Supported Devices codename: S9 "aka. starlte aka. G960" |||||| S9+ "aka. star2lte aka. G965" |||||| Note 9 "aka. crownlte aka. N960"
Find a file
Michal Hocko f372ac0415
BACKPORT: mm: introduce kv[mz]alloc helpers
Patch series "kvmalloc", v5.

There are many open coded kmalloc with vmalloc fallback instances in the
tree.  Most of them are not careful enough or simply do not care about
the underlying semantic of the kmalloc/page allocator which means that
a) some vmalloc fallbacks are basically unreachable because the kmalloc
part will keep retrying until it succeeds b) the page allocator can
invoke a really disruptive steps like the OOM killer to move forward
which doesn't sound appropriate when we consider that the vmalloc
fallback is available.

As it can be seen implementing kvmalloc requires quite an intimate
knowledge if the page allocator and the memory reclaim internals which
strongly suggests that a helper should be implemented in the memory
subsystem proper.

Most callers, I could find, have been converted to use the helper
instead.  This is patch 6.  There are some more relying on __GFP_REPEAT
in the networking stack which I have converted as well and Eric Dumazet
was not opposed [2] to convert them as well.

[1] http://lkml.kernel.org/r/20170130094940.13546-1-mhocko@kernel.org
[2] http://lkml.kernel.org/r/1485273626.16328.301.camel@edumazet-glaptop3.roam.corp.google.com

This patch (of 9):

Using kmalloc with the vmalloc fallback for larger allocations is a
common pattern in the kernel code.  Yet we do not have any common helper
for that and so users have invented their own helpers.  Some of them are
really creative when doing so.  Let's just add kv[mz]alloc and make sure
it is implemented properly.  This implementation makes sure to not make
a large memory pressure for > PAGE_SZE requests (__GFP_NORETRY) and also
to not warn about allocation failures.  This also rules out the OOM
killer as the vmalloc is a more approapriate fallback than a disruptive
user visible action.

This patch also changes some existing users and removes helpers which
are specific for them.  In some cases this is not possible (e.g.
ext4_kvmalloc, libcfs_kvzalloc) because those seems to be broken and
require GFP_NO{FS,IO} context which is not vmalloc compatible in general
(note that the page table allocation is GFP_KERNEL).  Those need to be
fixed separately.

While we are at it, document that __vmalloc{_node} about unsupported gfp
mask because there seems to be a lot of confusion out there.
kvmalloc_node will warn about GFP_KERNEL incompatible (which are not
superset) flags to catch new abusers.  Existing ones would have to die
slowly.

[sfr@canb.auug.org.au: f2fs fixup]
  Link: http://lkml.kernel.org/r/20170320163735.332e64b7@canb.auug.org.au
Link: http://lkml.kernel.org/r/20170306103032.2540-2-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>	[ext4 part]
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Angelo G. Del Regno <kholk11@gmail.com>
Signed-off-by: Yousef Algadri <yusufgadrie@gmail.com>
Signed-off-by: DennySPB <dennyspb@gmail.com>

,
2023-02-21 00:19:39 +03:00
arch BACKPORT: mm: introduce kv[mz]alloc helpers 2023-02-21 00:19:39 +03:00
block Merge 4.9.219 branch 'android-4.9-q' into tw10-android-4.9-q 2020-04-22 21:31:43 +03:00
certs This is the 4.9.126 stable release 2018-09-10 09:20:19 +02:00
crypto treewide: fix build with clang 2023-02-21 00:11:01 +03:00
Documentation Import N960FXXU5DTCA OSRC 2023-02-21 00:11:04 +03:00
drivers BACKPORT: mm: introduce kv[mz]alloc helpers 2023-02-21 00:19:39 +03:00
firmware Merge 4.9.212 branch 'android-4.9-q' into tw10-android-4.9-q 2020-02-12 12:32:38 +02:00
fs BACKPORT: mm: introduce kv[mz]alloc helpers 2023-02-21 00:19:39 +03:00
include BACKPORT: mm: introduce kv[mz]alloc helpers 2023-02-21 00:19:39 +03:00
init init: Kconfig: fix unknown option imply error 2023-02-21 00:18:00 +03:00
ipc BACKPORT: mm: introduce kv[mz]alloc helpers 2023-02-21 00:19:39 +03:00
kernel import PAGE_BOOST from N10 Lite 2023-02-21 00:19:34 +03:00
lib kobject: Add support for default attribute groups to kobj_type 2023-02-21 00:11:02 +03:00
mm BACKPORT: mm: introduce kv[mz]alloc helpers 2023-02-21 00:19:39 +03:00
net cfg80211: Add support for randomizing TA of Public Action 2023-02-21 00:15:30 +03:00
samples This is the 4.9.209 stable release 2020-01-12 12:14:52 +01:00
scripts kbuild: use HOSTLDFLAGS for single .c executables 2023-02-21 00:16:36 +03:00
security BACKPORT: mm: introduce kv[mz]alloc helpers 2023-02-21 00:19:39 +03:00
sound Port N770FXXU8GVG4 changes 2023-02-21 00:17:59 +03:00
tools Merge 4.9.219 branch 'android-4.9-q' into tw10-android-4.9-q 2020-04-22 21:31:43 +03:00
usr usr/Kconfig: make initrd compression algorithm selection not expert 2014-12-13 12:42:52 -08:00
virt BACKPORT: mm: introduce kv[mz]alloc helpers 2023-02-21 00:19:39 +03:00
.cocciconfig scripts: add Linux .cocciconfig for coccinelle 2016-07-22 12:13:39 +02:00
.get_maintainer.ignore Add hch to .get_maintainer.ignore 2015-08-21 14:30:10 -07:00
.gitattributes .gitattributes: set git diff driver for C source code files 2016-10-07 18:46:30 -07:00
.gitignore .gitignore: update 2023-02-21 00:11:21 +03:00
.mailmap Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2016-10-15 09:26:12 -07:00
AndroidKernel.mk import G965FXXU7DTAA OSRC 2020-02-04 13:50:09 +02:00
build.config.aarch64 ANDROID: refactor build.config files to remove duplication 2019-10-23 12:11:09 +00:00
build.config.common ANDROID: clang: update to 9.0.8 based on r365631c 2019-10-23 21:26:07 +00:00
build.config.cuttlefish.aarch64 ANDROID: refactor build.config files to remove duplication 2019-10-23 12:11:09 +00:00
build.config.cuttlefish.x86_64 ANDROID: refactor build.config files to remove duplication 2019-10-23 12:11:09 +00:00
build.config.goldfish.arm ANDROID: build.config: enforce trace_printk check 2018-05-07 23:46:39 +00:00
build.config.goldfish.arm64 ANDROID: build.config: enforce trace_printk check 2018-05-07 23:46:39 +00:00
build.config.goldfish.mips ANDROID: build.config: enforce trace_printk check 2018-05-07 23:46:39 +00:00
build.config.goldfish.mips64 ANDROID: build.config: enforce trace_printk check 2018-05-07 23:46:39 +00:00
build.config.goldfish.x86 ANDROID: build.config: enforce trace_printk check 2018-05-07 23:46:39 +00:00
build.config.goldfish.x86_64 ANDROID: build.config: enforce trace_printk check 2018-05-07 23:46:39 +00:00
build.config.universal9810 import G965FXXU7DTAA OSRC 2020-02-04 13:50:09 +02:00
build.config.x86_64 ANDROID: refactor build.config files to remove duplication 2019-10-23 12:11:09 +00:00
build_kernel.sh import G96xFXXU7DTB4 OSRC 2020-03-27 23:59:55 +02:00
buildN9.sh BuildScript: update for new config system 2023-02-21 00:11:19 +03:00
buildS9+.sh BuildScript: update for new config system 2023-02-21 00:11:19 +03:00
buildS9.sh BuildScript: update for new config system 2023-02-21 00:11:19 +03:00
clean.sh Update Buildscript 2023-02-21 00:10:52 +03:00
COPYING [PATCH] update FSF address in COPYING 2005-09-10 10:06:29 -07:00
CREDITS Fix up a couple of field names in the CREDITS file 2016-12-02 10:48:50 -08:00
Kbuild kbuild: Consolidate header generation from ASM offset information 2018-11-23 08:20:34 +01:00
Kconfig import G965FXXU7DTAA OSRC 2020-02-04 13:50:09 +02:00
MAINTAINERS FROMLIST: HID: nintendo: add nintendo switch controller driver 2020-02-28 11:02:31 -08:00
Makefile Makefile: change ANDROID_MAJOR_VERSION to t 2023-02-21 00:19:33 +03:00
README README: Delete obsolete i386 info + update arch/i386/ paths 2016-08-14 12:24:56 -06:00
README.md import G96XFXXUGFUG4 OSRC 2023-02-21 00:10:27 +03:00
REPORTING-BUGS Docs: fix missing word in REPORTING-BUGS 2016-02-15 11:18:23 +01:00
verity_dev_keys.x509 x86_64_cuttlefish_defconfig: enable verity cert 2018-07-26 10:36:03 -07:00