Skip to content

Commit ef8f3d4

Browse files
committed
Merge branch 'akpm' (patches from Andrew)
Merge updates from Andrew Morton: "Am experimenting with splitting MM up into identifiable subsystems perhaps with a view to gitifying it in complex ways. Also with more verbose "incoming" emails. Most of MM is here and a few other trees. Subsystems affected by this patch series: - hotfixes - iommu - scripts - arch/sh - ocfs2 - mm:slab-generic - mm:slub - mm:kmemleak - mm:kasan - mm:cleanups - mm:debug - mm:pagecache - mm:swap - mm:memcg - mm:gup - mm:pagemap - mm:infrastructure - mm:vmalloc - mm:initialization - mm:pagealloc - mm:vmscan - mm:tools - mm:proc - mm:ras - mm:oom-kill hotfixes: mm: vmscan: scan anonymous pages on file refaults mm/nvdimm: add is_ioremap_addr and use that to check ioremap address mm/memcontrol: fix wrong statistics in memory.stat mm/z3fold.c: lock z3fold page before __SetPageMovable() nilfs2: do not use unexported cpu_to_le32()/le32_to_cpu() in uapi header MAINTAINERS: nilfs2: update email address iommu: include/linux/dmar.h: replace single-char identifiers in macros scripts: scripts/decode_stacktrace: match basepath using shell prefix operator, not regex scripts/decode_stacktrace: look for modules with .ko.debug extension scripts/spelling.txt: drop "sepc" from the misspelling list scripts/spelling.txt: add spelling fix for prohibited scripts/decode_stacktrace: Accept dash/underscore in modules scripts/spelling.txt: add more spellings to spelling.txt arch/sh: arch/sh/configs/sdk7786_defconfig: remove CONFIG_LOGFS sh: config: remove left-over BACKLIGHT_LCD_SUPPORT sh: prevent warnings when using iounmap ocfs2: fs: ocfs: fix spelling mistake "hearbeating" -> "heartbeat" ocfs2/dlm: use struct_size() helper ocfs2: add last unlock times in locking_state ocfs2: add locking filter debugfs file ocfs2: add first lock wait time in locking_state ocfs: no need to check return value of debugfs_create functions fs/ocfs2/dlmglue.c: unneeded variable: "status" ocfs2: use kmemdup rather than duplicating its implementation mm:slab-generic: Patch series "mm/slab: Improved sanity checking": mm/slab: validate cache membership under freelist hardening mm/slab: sanity-check page type when looking up cache lkdtm/heap: add tests for freelist hardening mm:slub: mm/slub.c: avoid double string traverse in kmem_cache_flags() slub: don't panic for memcg kmem cache creation failure mm:kmemleak: mm/kmemleak.c: fix check for softirq context mm/kmemleak.c: change error at _write when kmemleak is disabled docs: kmemleak: add more documentation details mm:kasan: mm/kasan: print frame description for stack bugs Patch series "Bitops instrumentation for KASAN", v5: lib/test_kasan: add bitops tests x86: use static_cpu_has in uaccess region to avoid instrumentation asm-generic, x86: add bitops instrumentation for KASAN Patch series "mm/kasan: Add object validation in ksize()", v3: mm/kasan: introduce __kasan_check_{read,write} mm/kasan: change kasan_check_{read,write} to return boolean lib/test_kasan: Add test for double-kzfree detection mm/slab: refactor common ksize KASAN logic into slab_common.c mm/kasan: add object validation in ksize() mm:cleanups: include/linux/pfn_t.h: remove pfn_t_to_virt() Patch series "remove ARCH_SELECT_MEMORY_MODEL where it has no effect": arm: remove ARCH_SELECT_MEMORY_MODEL s390: remove ARCH_SELECT_MEMORY_MODEL sparc: remove ARCH_SELECT_MEMORY_MODEL mm/gup.c: make follow_page_mask() static mm/memory.c: trivial clean up in insert_page() mm: make !CONFIG_HUGE_PAGE wrappers into static inlines include/linux/mm_types.h: ifdef struct vm_area_struct::swap_readahead_info mm: remove the account_page_dirtied export mm/page_isolation.c: change the prototype of undo_isolate_page_range() include/linux/vmpressure.h: use spinlock_t instead of struct spinlock mm: remove the exporting of totalram_pages include/linux/pagemap.h: document trylock_page() return value mm:debug: mm/failslab.c: by default, do not fail allocations with direct reclaim only Patch series "debug_pagealloc improvements": mm, debug_pagelloc: use static keys to enable debugging mm, page_alloc: more extensive free page checking with debug_pagealloc mm, debug_pagealloc: use a page type instead of page_ext flag mm:pagecache: Patch series "fix filler_t callback type mismatches", v2: mm/filemap.c: fix an overly long line in read_cache_page mm/filemap: don't cast ->readpage to filler_t for do_read_cache_page jffs2: pass the correct prototype to read_cache_page 9p: pass the correct prototype to read_cache_page mm/filemap.c: correct the comment about VM_FAULT_RETRY mm:swap: mm, swap: fix race between swapoff and some swap operations mm/swap_state.c: simplify total_swapcache_pages() with get_swap_device() mm, swap: use rbtree for swap_extent mm/mincore.c: fix race between swapoff and mincore mm:memcg: memcg, oom: no oom-kill for __GFP_RETRY_MAYFAIL memcg, fsnotify: no oom-kill for remote memcg charging mm, memcg: introduce memory.events.local mm: memcontrol: dump memory.stat during cgroup OOM Patch series "mm: reparent slab memory on cgroup removal", v7: mm: memcg/slab: postpone kmem_cache memcg pointer initialization to memcg_link_cache() mm: memcg/slab: rename slab delayed deactivation functions and fields mm: memcg/slab: generalize postponed non-root kmem_cache deactivation mm: memcg/slab: introduce __memcg_kmem_uncharge_memcg() mm: memcg/slab: unify SLAB and SLUB page accounting mm: memcg/slab: don't check the dying flag on kmem_cache creation mm: memcg/slab: synchronize access to kmem_cache dying flag using a spinlock mm: memcg/slab: rework non-root kmem_cache lifecycle management mm: memcg/slab: stop setting page->mem_cgroup pointer for slab pages mm: memcg/slab: reparent memcg kmem_caches on cgroup removal mm, memcg: add a memcg_slabinfo debugfs file mm:gup: Patch series "switch the remaining architectures to use generic GUP", v4: mm: use untagged_addr() for get_user_pages_fast addresses mm: simplify gup_fast_permitted mm: lift the x86_32 PAE version of gup_get_pte to common code MIPS: use the generic get_user_pages_fast code sh: add the missing pud_page definition sh: use the generic get_user_pages_fast code sparc64: add the missing pgd_page definition sparc64: define untagged_addr() sparc64: use the generic get_user_pages_fast code mm: rename CONFIG_HAVE_GENERIC_GUP to CONFIG_HAVE_FAST_GUP mm: reorder code blocks in gup.c mm: consolidate the get_user_pages* implementations mm: validate get_user_pages_fast flags mm: move the powerpc hugepd code to mm/gup.c mm: switch gup_hugepte to use try_get_compound_head mm: mark the page referenced in gup_hugepte mm/gup: speed up check_and_migrate_cma_pages() on huge page mm/gup.c: remove some BUG_ONs from get_gate_page() mm/gup.c: mark undo_dev_pagemap as __maybe_unused mm:pagemap: asm-generic, x86: introduce generic pte_{alloc,free}_one[_kernel] alpha: switch to generic version of pte allocation arm: switch to generic version of pte allocation arm64: switch to generic version of pte allocation csky: switch to generic version of pte allocation m68k: sun3: switch to generic version of pte allocation mips: switch to generic version of pte allocation nds32: switch to generic version of pte allocation nios2: switch to generic version of pte allocation parisc: switch to generic version of pte allocation riscv: switch to generic version of pte allocation um: switch to generic version of pte allocation unicore32: switch to generic version of pte allocation mm/pgtable: drop pgtable_t variable from pte_fn_t functions mm/memory.c: fail when offset == num in first check of __vm_map_pages() mm:infrastructure: mm/mmu_notifier: use hlist_add_head_rcu() mm:vmalloc: Patch series "Some cleanups for the KVA/vmalloc", v5: mm/vmalloc.c: remove "node" argument mm/vmalloc.c: preload a CPU with one object for split purpose mm/vmalloc.c: get rid of one single unlink_va() when merge mm/vmalloc.c: switch to WARN_ON() and move it under unlink_va() mm/vmalloc.c: spelling> s/informaion/information/ mm:initialization: mm/large system hash: use vmalloc for size > MAX_ORDER when !hashdist mm/large system hash: clear hashdist when only one node with memory is booted mm:pagealloc: arm64: move jump_label_init() before parse_early_param() Patch series "add init_on_alloc/init_on_free boot options", v10: mm: security: introduce init_on_alloc=1 and init_on_free=1 boot options mm: init: report memory auto-initialization features at boot time mm:vmscan: mm: vmscan: remove double slab pressure by inc'ing sc->nr_scanned mm: vmscan: correct some vmscan counters for THP swapout mm:tools: tools/vm/slabinfo: order command line options tools/vm/slabinfo: add partial slab listing to -X tools/vm/slabinfo: add option to sort by partial slabs tools/vm/slabinfo: add sorting info to help menu mm:proc: proc: use down_read_killable mmap_sem for /proc/pid/maps proc: use down_read_killable mmap_sem for /proc/pid/smaps_rollup proc: use down_read_killable mmap_sem for /proc/pid/pagemap proc: use down_read_killable mmap_sem for /proc/pid/clear_refs proc: use down_read_killable mmap_sem for /proc/pid/map_files mm: use down_read_killable for locking mmap_sem in access_remote_vm mm: smaps: split PSS into components mm: vmalloc: show number of vmalloc pages in /proc/meminfo mm:ras: mm/memory-failure.c: clarify error message mm:oom-kill: mm: memcontrol: use CSS_TASK_ITER_PROCS at mem_cgroup_scan_tasks() mm, oom: refactor dump_tasks for memcg OOMs mm, oom: remove redundant task_in_mem_cgroup() check oom: decouple mems_allowed from oom_unkillable_task mm/oom_kill.c: remove redundant OOM score normalization in select_bad_process()" * akpm: (147 commits) mm/oom_kill.c: remove redundant OOM score normalization in select_bad_process() oom: decouple mems_allowed from oom_unkillable_task mm, oom: remove redundant task_in_mem_cgroup() check mm, oom: refactor dump_tasks for memcg OOMs mm: memcontrol: use CSS_TASK_ITER_PROCS at mem_cgroup_scan_tasks() mm/memory-failure.c: clarify error message mm: vmalloc: show number of vmalloc pages in /proc/meminfo mm: smaps: split PSS into components mm: use down_read_killable for locking mmap_sem in access_remote_vm proc: use down_read_killable mmap_sem for /proc/pid/map_files proc: use down_read_killable mmap_sem for /proc/pid/clear_refs proc: use down_read_killable mmap_sem for /proc/pid/pagemap proc: use down_read_killable mmap_sem for /proc/pid/smaps_rollup proc: use down_read_killable mmap_sem for /proc/pid/maps tools/vm/slabinfo: add sorting info to help menu tools/vm/slabinfo: add option to sort by partial slabs tools/vm/slabinfo: add partial slab listing to -X tools/vm/slabinfo: order command line options mm: vmscan: correct some vmscan counters for THP swapout mm: vmscan: remove double slab pressure by inc'ing sc->nr_scanned ...
2 parents d7d170a + 2c20798 commit ef8f3d4

File tree

173 files changed

+3586
-3381
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+3586
-3381
lines changed

Documentation/ABI/testing/procfs-smaps_rollup

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,28 @@ Date: August 2017
33
Contact: Daniel Colascione <[email protected]>
44
Description:
55
This file provides pre-summed memory information for a
6-
process. The format is identical to /proc/pid/smaps,
6+
process. The format is almost identical to /proc/pid/smaps,
77
except instead of an entry for each VMA in a process,
88
smaps_rollup has a single entry (tagged "[rollup]")
99
for which each field is the sum of the corresponding
1010
fields from all the maps in /proc/pid/smaps.
11-
For more details, see the procfs man page.
11+
Additionally, the fields Pss_Anon, Pss_File and Pss_Shmem
12+
are not present in /proc/pid/smaps. These fields represent
13+
the sum of the Pss field of each type (anon, file, shmem).
14+
For more details, see Documentation/filesystems/proc.txt
15+
and the procfs man page.
1216

1317
Typical output looks like this:
1418

1519
00100000-ff709000 ---p 00000000 00:00 0 [rollup]
20+
Size: 1192 kB
21+
KernelPageSize: 4 kB
22+
MMUPageSize: 4 kB
1623
Rss: 884 kB
1724
Pss: 385 kB
25+
Pss_Anon: 301 kB
26+
Pss_File: 80 kB
27+
Pss_Shmem: 4 kB
1828
Shared_Clean: 696 kB
1929
Shared_Dirty: 0 kB
2030
Private_Clean: 120 kB

Documentation/admin-guide/cgroup-v2.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,11 @@ PAGE_SIZE multiple when read back.
11461146
otherwise, a value change in this file generates a file
11471147
modified event.
11481148

1149+
Note that all fields in this file are hierarchical and the
1150+
file modified event can be generated due to an event down the
1151+
hierarchy. For for the local events at the cgroup level see
1152+
memory.events.local.
1153+
11491154
low
11501155
The number of times the cgroup is reclaimed due to
11511156
high memory pressure even though its usage is under
@@ -1185,6 +1190,11 @@ PAGE_SIZE multiple when read back.
11851190
The number of processes belonging to this cgroup
11861191
killed by any kind of OOM killer.
11871192

1193+
memory.events.local
1194+
Similar to memory.events but the fields in the file are local
1195+
to the cgroup i.e. not hierarchical. The file modified event
1196+
generated on this file reflects only the local events.
1197+
11881198
memory.stat
11891199
A read-only flat-keyed file which exists on non-root cgroups.
11901200

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -805,12 +805,10 @@
805805
tracking down these problems.
806806

807807
debug_pagealloc=
808-
[KNL] When CONFIG_DEBUG_PAGEALLOC is set, this
809-
parameter enables the feature at boot time. In
810-
default, it is disabled. We can avoid allocating huge
811-
chunk of memory for debug pagealloc if we don't enable
812-
it at boot time and the system will work mostly same
813-
with the kernel built without CONFIG_DEBUG_PAGEALLOC.
808+
[KNL] When CONFIG_DEBUG_PAGEALLOC is set, this parameter
809+
enables the feature at boot time. By default, it is
810+
disabled and the system will work mostly the same as a
811+
kernel built without CONFIG_DEBUG_PAGEALLOC.
814812
on: enable the feature
815813

816814
debugpat [X86] Enable PAT debugging
@@ -1670,6 +1668,15 @@
16701668

16711669
initrd= [BOOT] Specify the location of the initial ramdisk
16721670

1671+
init_on_alloc= [MM] Fill newly allocated pages and heap objects with
1672+
zeroes.
1673+
Format: 0 | 1
1674+
Default set by CONFIG_INIT_ON_ALLOC_DEFAULT_ON.
1675+
1676+
init_on_free= [MM] Fill freed pages and heap objects with zeroes.
1677+
Format: 0 | 1
1678+
Default set by CONFIG_INIT_ON_FREE_DEFAULT_ON.
1679+
16731680
init_pkru= [x86] Specify the default memory protection keys rights
16741681
register contents for all processes. 0x55555554 by
16751682
default (disallow access to all but pkey 0). Can

Documentation/core-api/kernel-api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The Linux kernel provides more basic utility functions.
5454
Bit Operations
5555
--------------
5656

57-
.. kernel-doc:: arch/x86/include/asm/bitops.h
57+
.. kernel-doc:: include/asm-generic/bitops-instrumented.h
5858
:internal:
5959

6060
Bitmap Operations

Documentation/dev-tools/kmemleak.rst

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ Kernel Memory Leak Detector
22
===========================
33

44
Kmemleak provides a way of detecting possible kernel memory leaks in a
5-
way similar to a tracing garbage collector
6-
(https://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29#Tracing_garbage_collectors),
5+
way similar to a `tracing garbage collector
6+
<https://en.wikipedia.org/wiki/Tracing_garbage_collection>`_,
77
with the difference that the orphan objects are not freed but only
88
reported via /sys/kernel/debug/kmemleak. A similar method is used by the
99
Valgrind tool (``memcheck --leak-check``) to detect the memory leaks in
@@ -15,10 +15,13 @@ Usage
1515

1616
CONFIG_DEBUG_KMEMLEAK in "Kernel hacking" has to be enabled. A kernel
1717
thread scans the memory every 10 minutes (by default) and prints the
18-
number of new unreferenced objects found. To display the details of all
19-
the possible memory leaks::
18+
number of new unreferenced objects found. If the ``debugfs`` isn't already
19+
mounted, mount with::
2020

2121
# mount -t debugfs nodev /sys/kernel/debug/
22+
23+
To display the details of all the possible scanned memory leaks::
24+
2225
# cat /sys/kernel/debug/kmemleak
2326

2427
To trigger an intermediate memory scan::
@@ -72,6 +75,9 @@ If CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF are enabled, the kmemleak is
7275
disabled by default. Passing ``kmemleak=on`` on the kernel command
7376
line enables the function.
7477

78+
If you are getting errors like "Error while writing to stdout" or "write_loop:
79+
Invalid argument", make sure kmemleak is properly enabled.
80+
7581
Basic Algorithm
7682
---------------
7783

@@ -218,3 +224,37 @@ the pointer is calculated by other methods than the usual container_of
218224
macro or the pointer is stored in a location not scanned by kmemleak.
219225

220226
Page allocations and ioremap are not tracked.
227+
228+
Testing with kmemleak-test
229+
--------------------------
230+
231+
To check if you have all set up to use kmemleak, you can use the kmemleak-test
232+
module, a module that deliberately leaks memory. Set CONFIG_DEBUG_KMEMLEAK_TEST
233+
as module (it can't be used as bult-in) and boot the kernel with kmemleak
234+
enabled. Load the module and perform a scan with::
235+
236+
# modprobe kmemleak-test
237+
# echo scan > /sys/kernel/debug/kmemleak
238+
239+
Note that the you may not get results instantly or on the first scanning. When
240+
kmemleak gets results, it'll log ``kmemleak: <count of leaks> new suspected
241+
memory leaks``. Then read the file to see then::
242+
243+
# cat /sys/kernel/debug/kmemleak
244+
unreferenced object 0xffff89862ca702e8 (size 32):
245+
comm "modprobe", pid 2088, jiffies 4294680594 (age 375.486s)
246+
hex dump (first 32 bytes):
247+
6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
248+
6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b a5 kkkkkkkkkkkkkkk.
249+
backtrace:
250+
[<00000000e0a73ec7>] 0xffffffffc01d2036
251+
[<000000000c5d2a46>] do_one_initcall+0x41/0x1df
252+
[<0000000046db7e0a>] do_init_module+0x55/0x200
253+
[<00000000542b9814>] load_module+0x203c/0x2480
254+
[<00000000c2850256>] __do_sys_finit_module+0xba/0xe0
255+
[<000000006564e7ef>] do_syscall_64+0x43/0x110
256+
[<000000007c873fa6>] entry_SYSCALL_64_after_hwframe+0x44/0xa9
257+
...
258+
259+
Removing the module with ``rmmod kmemleak_test`` should also trigger some
260+
kmemleak results.

Documentation/filesystems/proc.txt

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,11 @@ Table 1-1: Process specific entries in /proc
154154
symbol the task is blocked in - or "0" if not blocked.
155155
pagemap Page table
156156
stack Report full stack trace, enable via CONFIG_STACKTRACE
157-
smaps an extension based on maps, showing the memory consumption of
157+
smaps An extension based on maps, showing the memory consumption of
158158
each mapping and flags associated with it
159-
numa_maps an extension based on maps, showing the memory locality and
159+
smaps_rollup Accumulated smaps stats for all mappings of the process. This
160+
can be derived from smaps, but is faster and more convenient
161+
numa_maps An extension based on maps, showing the memory locality and
160162
binding policy as well as mem usage (in pages) of each mapping.
161163
..............................................................................
162164

@@ -366,7 +368,7 @@ Table 1-4: Contents of the stat files (as of 2.6.30-rc7)
366368
exit_code the thread's exit_code in the form reported by the waitpid system call
367369
..............................................................................
368370

369-
The /proc/PID/maps file containing the currently mapped memory regions and
371+
The /proc/PID/maps file contains the currently mapped memory regions and
370372
their access permissions.
371373

372374
The format is:
@@ -417,11 +419,14 @@ is not associated with a file:
417419
or if empty, the mapping is anonymous.
418420

419421
The /proc/PID/smaps is an extension based on maps, showing the memory
420-
consumption for each of the process's mappings. For each of mappings there
421-
is a series of lines such as the following:
422+
consumption for each of the process's mappings. For each mapping (aka Virtual
423+
Memory Area, or VMA) there is a series of lines such as the following:
422424

423425
08048000-080bc000 r-xp 00000000 03:02 13130 /bin/bash
426+
424427
Size: 1084 kB
428+
KernelPageSize: 4 kB
429+
MMUPageSize: 4 kB
425430
Rss: 892 kB
426431
Pss: 374 kB
427432
Shared_Clean: 892 kB
@@ -443,11 +448,14 @@ Locked: 0 kB
443448
THPeligible: 0
444449
VmFlags: rd ex mr mw me dw
445450

446-
the first of these lines shows the same information as is displayed for the
447-
mapping in /proc/PID/maps. The remaining lines show the size of the mapping
448-
(size), the amount of the mapping that is currently resident in RAM (RSS), the
449-
process' proportional share of this mapping (PSS), the number of clean and
450-
dirty private pages in the mapping.
451+
The first of these lines shows the same information as is displayed for the
452+
mapping in /proc/PID/maps. Following lines show the size of the mapping
453+
(size); the size of each page allocated when backing a VMA (KernelPageSize),
454+
which is usually the same as the size in the page table entries; the page size
455+
used by the MMU when backing a VMA (in most cases, the same as KernelPageSize);
456+
the amount of the mapping that is currently resident in RAM (RSS); the
457+
process' proportional share of this mapping (PSS); and the number of clean and
458+
dirty shared and private pages in the mapping.
451459

452460
The "proportional set size" (PSS) of a process is the count of pages it has
453461
in memory, where each page is divided by the number of processes sharing it.
@@ -532,6 +540,19 @@ guarantees:
532540
2) If there is something at a given vaddr during the entirety of the
533541
life of the smaps/maps walk, there will be some output for it.
534542

543+
The /proc/PID/smaps_rollup file includes the same fields as /proc/PID/smaps,
544+
but their values are the sums of the corresponding values for all mappings of
545+
the process. Additionally, it contains these fields:
546+
547+
Pss_Anon
548+
Pss_File
549+
Pss_Shmem
550+
551+
They represent the proportional shares of anonymous, file, and shmem pages, as
552+
described for smaps above. These fields are omitted in smaps since each
553+
mapping identifies the type (anon, file, or shmem) of all pages it contains.
554+
Thus all information in smaps_rollup can be derived from smaps, but at a
555+
significantly higher cost.
535556

536557
The /proc/PID/clear_refs is used to reset the PG_Referenced and ACCESSED/YOUNG
537558
bits on both physical and virtual pages associated with a process, and the

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11260,7 +11260,7 @@ F: include/uapi/linux/nfs*
1126011260
F: include/uapi/linux/sunrpc/
1126111261

1126211262
NILFS2 FILESYSTEM
11263-
M: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
11263+
M: Ryusuke Konishi <konishi.ryusuke@gmail.com>
1126411264
1126511265
W: https://nilfs.sourceforge.io/
1126611266
W: https://nilfs.osdn.jp/

arch/alpha/include/asm/pgalloc.h

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include <linux/mm.h>
66
#include <linux/mmzone.h>
77

8+
#include <asm-generic/pgalloc.h> /* for pte_{alloc,free}_one */
9+
810
/*
911
* Allocate and free page tables. The xxx_kernel() versions are
1012
* used to allocate a kernel page table - this turns on ASN bits
@@ -41,7 +43,7 @@ pgd_free(struct mm_struct *mm, pgd_t *pgd)
4143
static inline pmd_t *
4244
pmd_alloc_one(struct mm_struct *mm, unsigned long address)
4345
{
44-
pmd_t *ret = (pmd_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
46+
pmd_t *ret = (pmd_t *)__get_free_page(GFP_PGTABLE_USER);
4547
return ret;
4648
}
4749

@@ -51,42 +53,6 @@ pmd_free(struct mm_struct *mm, pmd_t *pmd)
5153
free_page((unsigned long)pmd);
5254
}
5355

54-
static inline pte_t *
55-
pte_alloc_one_kernel(struct mm_struct *mm)
56-
{
57-
pte_t *pte = (pte_t *)__get_free_page(GFP_KERNEL|__GFP_ZERO);
58-
return pte;
59-
}
60-
61-
static inline void
62-
pte_free_kernel(struct mm_struct *mm, pte_t *pte)
63-
{
64-
free_page((unsigned long)pte);
65-
}
66-
67-
static inline pgtable_t
68-
pte_alloc_one(struct mm_struct *mm)
69-
{
70-
pte_t *pte = pte_alloc_one_kernel(mm);
71-
struct page *page;
72-
73-
if (!pte)
74-
return NULL;
75-
page = virt_to_page(pte);
76-
if (!pgtable_page_ctor(page)) {
77-
__free_page(page);
78-
return NULL;
79-
}
80-
return page;
81-
}
82-
83-
static inline void
84-
pte_free(struct mm_struct *mm, pgtable_t page)
85-
{
86-
pgtable_page_dtor(page);
87-
__free_page(page);
88-
}
89-
9056
#define check_pgt_cache() do { } while (0)
9157

9258
#endif /* _ALPHA_PGALLOC_H */

arch/arm/Kconfig

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ config ARM
7575
select HAVE_DYNAMIC_FTRACE_WITH_REGS if HAVE_DYNAMIC_FTRACE
7676
select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
7777
select HAVE_EXIT_THREAD
78+
select HAVE_FAST_GUP if ARM_LPAE
7879
select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
7980
select HAVE_FUNCTION_GRAPH_TRACER if !THUMB2_KERNEL && !CC_IS_CLANG
8081
select HAVE_FUNCTION_TRACER if !XIP_KERNEL
@@ -1622,16 +1623,9 @@ config ARCH_SPARSEMEM_ENABLE
16221623
config ARCH_SPARSEMEM_DEFAULT
16231624
def_bool ARCH_SPARSEMEM_ENABLE
16241625

1625-
config ARCH_SELECT_MEMORY_MODEL
1626-
def_bool ARCH_SPARSEMEM_ENABLE
1627-
16281626
config HAVE_ARCH_PFN_VALID
16291627
def_bool ARCH_HAS_HOLES_MEMORYMODEL || !SPARSEMEM
16301628

1631-
config HAVE_GENERIC_GUP
1632-
def_bool y
1633-
depends on ARM_LPAE
1634-
16351629
config HIGHMEM
16361630
bool "High Memory Support"
16371631
depends on MMU

0 commit comments

Comments
 (0)