Skip to content

Commit d34fc1a

Browse files
committed
Merge branch 'akpm' (patches from Andrew)
Merge updates from Andrew Morton: - various misc bits - DAX updates - OCFS2 - most of MM * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (119 commits) mm,fork: introduce MADV_WIPEONFORK x86,mpx: make mpx depend on x86-64 to free up VMA flag mm: add /proc/pid/smaps_rollup mm: hugetlb: clear target sub-page last when clearing huge page mm: oom: let oom_reap_task and exit_mmap run concurrently swap: choose swap device according to numa node mm: replace TIF_MEMDIE checks by tsk_is_oom_victim mm, oom: do not rely on TIF_MEMDIE for memory reserves access z3fold: use per-cpu unbuddied lists mm, swap: don't use VMA based swap readahead if HDD is used as swap mm, swap: add sysfs interface for VMA based swap readahead mm, swap: VMA based swap readahead mm, swap: fix swap readahead marking mm, swap: add swap readahead hit statistics mm/vmalloc.c: don't reinvent the wheel but use existing llist API mm/vmstat.c: fix wrong comment selftests/memfd: add memfd_create hugetlbfs selftest mm/shmem: add hugetlbfs support to memfd_create() mm, devm_memremap_pages: use multi-order radix for ZONE_DEVICE lookups mm/vmalloc.c: halve the number of comparisons performed in pcpu_get_vm_areas() ...
2 parents 1c9fe44 + d2cd9ed commit d34fc1a

139 files changed

Lines changed: 3960 additions & 2068 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
What: /proc/pid/smaps_rollup
2+
Date: August 2017
3+
Contact: Daniel Colascione <dancol@google.com>
4+
Description:
5+
This file provides pre-summed memory information for a
6+
process. The format is identical to /proc/pid/smaps,
7+
except instead of an entry for each VMA in a process,
8+
smaps_rollup has a single entry (tagged "[rollup]")
9+
for which each field is the sum of the corresponding
10+
fields from all the maps in /proc/pid/smaps.
11+
For more details, see the procfs man page.
12+
13+
Typical output looks like this:
14+
15+
00100000-ff709000 ---p 00000000 00:00 0 [rollup]
16+
Rss: 884 kB
17+
Pss: 385 kB
18+
Shared_Clean: 696 kB
19+
Shared_Dirty: 0 kB
20+
Private_Clean: 120 kB
21+
Private_Dirty: 68 kB
22+
Referenced: 884 kB
23+
Anonymous: 68 kB
24+
LazyFree: 0 kB
25+
AnonHugePages: 0 kB
26+
ShmemPmdMapped: 0 kB
27+
Shared_Hugetlb: 0 kB
28+
Private_Hugetlb: 0 kB
29+
Swap: 0 kB
30+
SwapPss: 0 kB
31+
Locked: 385 kB

‎Documentation/ABI/testing/sysfs-block-zram‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,11 @@ Description:
9090
device's debugging info useful for kernel developers. Its
9191
format is not documented intentionally and may change
9292
anytime without any notice.
93+
94+
What: /sys/block/zram<id>/backing_dev
95+
Date: June 2017
96+
Contact: Minchan Kim <minchan@kernel.org>
97+
Description:
98+
The backing_dev file is read-write and set up backing
99+
device for zram to write incompressible pages.
100+
For using, user should enable CONFIG_ZRAM_WRITEBACK.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
What: /sys/kernel/mm/swap/
2+
Date: August 2017
3+
Contact: Linux memory management mailing list <linux-mm@kvack.org>
4+
Description: Interface for swapping
5+
6+
What: /sys/kernel/mm/swap/vma_ra_enabled
7+
Date: August 2017
8+
Contact: Linux memory management mailing list <linux-mm@kvack.org>
9+
Description: Enable/disable VMA based swap readahead.
10+
11+
If set to true, the VMA based swap readahead algorithm
12+
will be used for swappable anonymous pages mapped in a
13+
VMA, and the global swap readahead algorithm will be
14+
still used for tmpfs etc. other users. If set to
15+
false, the global swap readahead algorithm will be
16+
used for all swappable pages.
17+
18+
What: /sys/kernel/mm/swap/vma_ra_max_order
19+
Date: August 2017
20+
Contact: Linux memory management mailing list <linux-mm@kvack.org>
21+
Description: The max readahead size in order for VMA based swap readahead
22+
23+
VMA based swap readahead algorithm will readahead at
24+
most 1 << max_order pages for each readahead. The
25+
real readahead size for each readahead will be scaled
26+
according to the estimation algorithm.

‎Documentation/admin-guide/kernel-parameters.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2783,7 +2783,7 @@
27832783
Allowed values are enable and disable
27842784

27852785
numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA.
2786-
one of ['zone', 'node', 'default'] can be specified
2786+
'node', 'default' can be specified
27872787
This can be set from sysctl after boot.
27882788
See Documentation/sysctl/vm.txt for details.
27892789

‎Documentation/blockdev/zram.txt‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ max_comp_streams RW the number of possible concurrent compress operations
168168
comp_algorithm RW show and change the compression algorithm
169169
compact WO trigger memory compaction
170170
debug_stat RO this file is used for zram debugging purposes
171+
backing_dev RW set up backend storage for zram to write out
171172

172173

173174
User space is advised to use the following files to read the device statistics.
@@ -231,5 +232,15 @@ line of text and contains the following stats separated by whitespace:
231232
resets the disksize to zero. You must set the disksize again
232233
before reusing the device.
233234

235+
* Optional Feature
236+
237+
= writeback
238+
239+
With incompressible pages, there is no memory saving with zram.
240+
Instead, with CONFIG_ZRAM_WRITEBACK, zram can write incompressible page
241+
to backing storage rather than keeping it in memory.
242+
User should set up backing device via /sys/block/zramX/backing_dev
243+
before disksize setting.
244+
234245
Nitin Gupta
235246
ngupta@vflare.org

‎Documentation/filesystems/caching/netfs-api.txt‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ To define an object, a structure of the following type should be filled out:
151151
void (*mark_pages_cached)(void *cookie_netfs_data,
152152
struct address_space *mapping,
153153
struct pagevec *cached_pvec);
154-
155-
void (*now_uncached)(void *cookie_netfs_data);
156154
};
157155

158156
This has the following fields:

‎Documentation/filesystems/dax.txt‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,8 @@ Filesystem support consists of
6363
- implementing an mmap file operation for DAX files which sets the
6464
VM_MIXEDMAP and VM_HUGEPAGE flags on the VMA, and setting the vm_ops to
6565
include handlers for fault, pmd_fault, page_mkwrite, pfn_mkwrite. These
66-
handlers should probably call dax_iomap_fault() (for fault and page_mkwrite
67-
handlers), dax_iomap_pmd_fault(), dax_pfn_mkwrite() passing the appropriate
68-
iomap operations.
66+
handlers should probably call dax_iomap_fault() passing the appropriate
67+
fault size and iomap operations.
6968
- calling iomap_zero_range() passing appropriate iomap operations instead of
7069
block_truncate_page() for DAX files
7170
- ensuring that there is sufficient locking between reads, writes,

‎Documentation/sysctl/vm.txt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,9 @@ See Documentation/nommu-mmap.txt for more information.
572572

573573
numa_zonelist_order
574574

575-
This sysctl is only for NUMA.
575+
This sysctl is only for NUMA and it is deprecated. Anything but
576+
Node order will fail!
577+
576578
'where the memory is allocated from' is controlled by zonelists.
577579
(This documentation ignores ZONE_HIGHMEM/ZONE_DMA32 for simple explanation.
578580
you may be able to read ZONE_DMA as ZONE_DMA32...)

‎Documentation/vm/numa‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,8 @@ memory, Linux must decide whether to order the zonelists such that allocations
7979
fall back to the same zone type on a different node, or to a different zone
8080
type on the same node. This is an important consideration because some zones,
8181
such as DMA or DMA32, represent relatively scarce resources. Linux chooses
82-
a default zonelist order based on the sizes of the various zone types relative
83-
to the total memory of the node and the total memory of the system. The
84-
default zonelist order may be overridden using the numa_zonelist_order kernel
85-
boot parameter or sysctl. [see Documentation/admin-guide/kernel-parameters.rst and
86-
Documentation/sysctl/vm.txt]
82+
a default Node ordered zonelist. This means it tries to fallback to other zones
83+
from the same node before using remote nodes which are ordered by NUMA distance.
8784

8885
By default, Linux will attempt to satisfy memory allocation requests from the
8986
node to which the CPU that executes the request is assigned. Specifically,

‎Documentation/vm/swap_numa.txt‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
Automatically bind swap device to numa node
2+
-------------------------------------------
3+
4+
If the system has more than one swap device and swap device has the node
5+
information, we can make use of this information to decide which swap
6+
device to use in get_swap_pages() to get better performance.
7+
8+
9+
How to use this feature
10+
-----------------------
11+
12+
Swap device has priority and that decides the order of it to be used. To make
13+
use of automatically binding, there is no need to manipulate priority settings
14+
for swap devices. e.g. on a 2 node machine, assume 2 swap devices swapA and
15+
swapB, with swapA attached to node 0 and swapB attached to node 1, are going
16+
to be swapped on. Simply swapping them on by doing:
17+
# swapon /dev/swapA
18+
# swapon /dev/swapB
19+
20+
Then node 0 will use the two swap devices in the order of swapA then swapB and
21+
node 1 will use the two swap devices in the order of swapB then swapA. Note
22+
that the order of them being swapped on doesn't matter.
23+
24+
A more complex example on a 4 node machine. Assume 6 swap devices are going to
25+
be swapped on: swapA and swapB are attached to node 0, swapC is attached to
26+
node 1, swapD and swapE are attached to node 2 and swapF is attached to node3.
27+
The way to swap them on is the same as above:
28+
# swapon /dev/swapA
29+
# swapon /dev/swapB
30+
# swapon /dev/swapC
31+
# swapon /dev/swapD
32+
# swapon /dev/swapE
33+
# swapon /dev/swapF
34+
35+
Then node 0 will use them in the order of:
36+
swapA/swapB -> swapC -> swapD -> swapE -> swapF
37+
swapA and swapB will be used in a round robin mode before any other swap device.
38+
39+
node 1 will use them in the order of:
40+
swapC -> swapA -> swapB -> swapD -> swapE -> swapF
41+
42+
node 2 will use them in the order of:
43+
swapD/swapE -> swapA -> swapB -> swapC -> swapF
44+
Similaly, swapD and swapE will be used in a round robin mode before any
45+
other swap devices.
46+
47+
node 3 will use them in the order of:
48+
swapF -> swapA -> swapB -> swapC -> swapD -> swapE
49+
50+
51+
Implementation details
52+
----------------------
53+
54+
The current code uses a priority based list, swap_avail_list, to decide
55+
which swap device to use and if multiple swap devices share the same
56+
priority, they are used round robin. This change here replaces the single
57+
global swap_avail_list with a per-numa-node list, i.e. for each numa node,
58+
it sees its own priority based list of available swap devices. Swap
59+
device's priority can be promoted on its matching node's swap_avail_list.
60+
61+
The current swap device's priority is set as: user can set a >=0 value,
62+
or the system will pick one starting from -1 then downwards. The priority
63+
value in the swap_avail_list is the negated value of the swap device's
64+
due to plist being sorted from low to high. The new policy doesn't change
65+
the semantics for priority >=0 cases, the previous starting from -1 then
66+
downwards now becomes starting from -2 then downwards and -1 is reserved
67+
as the promoted value. So if multiple swap devices are attached to the same
68+
node, they will all be promoted to priority -1 on that node's plist and will
69+
be used round robin before any other swap devices.

0 commit comments

Comments
 (0)