projects/linux·commit 345671ea

Merge branch 'akpm' (patches from Andrew)

345671ea · Linus Torvalds <[email protected]> · 2018-10-26 19:33:41 -07:00

Merge updates from Andrew Morton:

 - a few misc things

 - ocfs2 updates

 - most of MM

* emailed patches from Andrew Morton <[email protected]>: (132 commits)
  hugetlbfs: dirty pages as they are added to pagecache
  mm: export add_swap_extent()
  mm: split SWP_FILE into SWP_ACTIVATED and SWP_FS
  tools/testing/selftests/vm/map_fixed_noreplace.c: add test for MAP_FIXED_NOREPLACE
  mm: thp: relocate flush_cache_range() in migrate_misplaced_transhuge_page()
  mm: thp: fix mmu_notifier in migrate_misplaced_transhuge_page()
  mm: thp: fix MADV_DONTNEED vs migrate_misplaced_transhuge_page race condition
  mm/kasan/quarantine.c: make quarantine_lock a raw_spinlock_t
  mm/gup: cache dev_pagemap while pinning pages
  Revert "x86/e820: put !E820_TYPE_RAM regions into memblock.reserved"
  mm: return zero_resv_unavail optimization
  mm: zero remaining unavailable struct pages
  tools/testing/selftests/vm/gup_benchmark.c: add MAP_HUGETLB option
  tools/testing/selftests/vm/gup_benchmark.c: add MAP_SHARED option
  tools/testing/selftests/vm/gup_benchmark.c: allow user specified file
  tools/testing/selftests/vm/gup_benchmark.c: fix 'write' flag usage
  mm/gup_benchmark.c: add additional pinning methods
  mm/gup_benchmark.c: time put_page()
  mm: don't raise MEMCG_OOM event due to failed high-order allocation
  mm/page-writeback.c: fix range_cyclic writeback vs writepages deadlock
  ...
Commit
345671ea0f9258f410eb057b9ced9cefbbe5dc78
Parents
49040081 · 22146c3c

Merge commit. Changes below are compared with the first parent: 49040081.

Changes

156 files changed · +3400 −1988

FileStatusAddDelContent
Documentation/accounting/psi.txtadded+73−0View file
Documentation/admin-guide/cgroup-v2.rstmodified+22−0View file
Documentation/admin-guide/kernel-parameters.txtmodified+12−0View file
Documentation/filesystems/proc.txtmodified+4−0View file
Documentation/vm/slub.rstmodified+9−3View file
Documentation/x86/pat.txtmodified+2−2View file
arch/alpha/Kconfigmodified+2−0View file
arch/alpha/kernel/core_irongate.cmodified+2−2View file
arch/alpha/kernel/setup.cmodified+12−86View file
arch/alpha/mm/numa.cmodified+13−100View file
arch/arm/include/asm/hugetlb-3level.hmodified+1−31View file
arch/arm/include/asm/hugetlb.hmodified+1−32View file
arch/arm64/include/asm/hugetlb.hmodified+7−32View file
arch/arm64/include/asm/string.hmodified+8−6View file
arch/arm64/kernel/arm64ksyms.cmodified+5−2View file
arch/arm64/lib/memchr.Smodified+1−1View file
arch/arm64/lib/memcmp.Smodified+1−1View file
arch/arm64/lib/strchr.Smodified+1−1View file
arch/arm64/lib/strcmp.Smodified+1−1View file
arch/arm64/lib/strlen.Smodified+1−1View file
arch/arm64/lib/strncmp.Smodified+1−1View file
arch/arm64/lib/strnlen.Smodified+1−1View file
arch/arm64/lib/strrchr.Smodified+1−1View file
arch/hexagon/Kconfigmodified+3−0View file
arch/hexagon/mm/init.cmodified+8−12View file
arch/ia64/include/asm/hugetlb.hmodified+5−42View file
arch/ia64/include/asm/pgtable.hmodified+0−1View file
arch/mips/include/asm/hugetlb.hmodified+7−33View file
arch/nios2/Kconfigmodified+3−0View file
arch/nios2/kernel/prom.cmodified+0−17View file
arch/nios2/kernel/setup.cmodified+7−32View file
arch/parisc/include/asm/hugetlb.hmodified+8−25View file
arch/powerpc/include/asm/book3s/32/pgtable.hmodified+0−6View file
arch/powerpc/include/asm/book3s/64/pgtable.hmodified+1−0View file
arch/powerpc/include/asm/hugetlb.hmodified+6−37View file
arch/powerpc/include/asm/nohash/32/pgtable.hmodified+0−6View file
arch/powerpc/include/asm/nohash/64/pgtable.hmodified+1−0View file
arch/powerpc/platforms/cell/cpufreq_spudemand.cmodified+1−1View file
arch/powerpc/platforms/cell/spufs/sched.cmodified+3−6View file
arch/s390/appldata/appldata_os.cmodified+0−4View file
arch/sh/include/asm/hugetlb.hmodified+4−50View file
arch/sparc/include/asm/hugetlb.hmodified+8−32View file
arch/um/Kconfigmodified+2−0View file
arch/um/kernel/physmem.cmodified+10−12View file
arch/unicore32/Kconfigmodified+1−0View file
arch/unicore32/mm/init.cmodified+1−53View file
arch/x86/entry/vdso/vma.cmodified+9−15View file
arch/x86/include/asm/hugetlb.hmodified+0−69View file
arch/x86/kernel/e820.cmodified+3−12View file
arch/xtensa/include/asm/Kbuildmodified+1−0View file
arch/xtensa/include/asm/vga.hdeleted+0−19View before deletion
block/blk-iolatency.cmodified+5−3View file
drivers/base/node.cmodified+12−7View file
drivers/cpuidle/governors/menu.cmodified+0−4View file
drivers/infiniband/hw/hfi1/mmu_rb.cmodified+0−1View file
drivers/iommu/amd_iommu_v2.cmodified+0−1View file
drivers/iommu/intel-svm.cmodified+0−1View file
drivers/misc/sgi-gru/grutlbpurge.cmodified+0−1View file
drivers/of/fdt.cmodified+6−5View file
drivers/staging/android/ion/ion_page_pool.cmodified+4−4View file
fs/cramfs/inode.cmodified+4−1View file
fs/dcache.cmodified+9−29View file
fs/iomap.cmodified+1−1View file
fs/kernfs/mount.cmodified+3−0View file
fs/ocfs2/alloc.cmodified+0−4View file
fs/ocfs2/aops.cmodified+1−2View file
fs/ocfs2/dlm/dlmdebug.cmodified+1−1View file
fs/ocfs2/dlm/dlmthread.cmodified+1−1View file
fs/ocfs2/refcounttree.cmodified+0−2View file
fs/proc/inode.cmodified+3−0View file
fs/proc/loadavg.cmodified+0−3View file
fs/proc/meminfo.cmodified+8−8View file
fs/proc/task_mmu.cmodified+3−1View file
fs/userfaultfd.cmodified+4−4View file
include/asm-generic/hugetlb.hmodified+87−1View file
include/asm-generic/pgtable.hmodified+2−2View file
include/linux/cgroup-defs.hmodified+4−0View file
include/linux/cgroup.hmodified+15−0View file
include/linux/delayacct.hmodified+23−0View file
include/linux/hmm.hmodified+1−1View file
include/linux/huge_mm.hmodified+4−4View file
include/linux/iomap.hmodified+3−1View file
include/linux/linkage.hmodified+1−0View file
include/linux/math64.hmodified+3−0View file
include/linux/memblock.hmodified+0−15View file
include/linux/memcontrol.hmodified+13−2View file
include/linux/mm.hmodified+9−39View file
include/linux/mmu_notifier.hmodified+3−24View file
include/linux/mmzone.hmodified+3−1View file
include/linux/page-flags.hmodified+13−1View file
include/linux/pfn_t.hmodified+3−1View file
include/linux/psi.hadded+53−0View file
include/linux/psi_types.hadded+92−0View file
include/linux/sched.hmodified+10−3View file
include/linux/sched/loadavg.hmodified+20−4View file
include/linux/slab.hmodified+45−11View file
include/linux/swap.hmodified+8−7View file
include/trace/events/mmflags.hmodified+1−0View file
include/uapi/linux/taskstats.hmodified+5−1View file
init/Kconfigmodified+19−0View file
kernel/cgroup/cgroup.cmodified+43−2View file
kernel/debug/kdb/kdb_main.cmodified+1−6View file
kernel/delayacct.cmodified+15−0View file
kernel/fork.cmodified+53−6View file
kernel/memremap.cmodified+10−15View file
kernel/sched/Makefilemodified+1−0View file
kernel/sched/core.cmodified+11−5View file
kernel/sched/loadavg.cmodified+62−77View file
kernel/sched/psi.cadded+759−0View file
kernel/sched/sched.hmodified+96−82View file
kernel/sched/stats.hmodified+86−0View file
lib/test_kasan.cmodified+70−0View file
mm/compaction.cmodified+5−0View file
mm/debug.cmodified+46−0View file
mm/filemap.cmodified+25−12View file
mm/gup.cmodified+67−48View file
mm/gup_benchmark.cmodified+33−4View file
mm/hmm.cmodified+7−5View file
mm/huge_memory.cmodified+20−11View file
mm/hugetlb.cmodified+6−0View file
mm/kasan/quarantine.cmodified+9−9View file
mm/kmemleak.cmodified+35−7View file
mm/memblock.cmodified+2−3View file
mm/memcontrol.cmodified+16−38View file
mm/memory.cmodified+90−66View file
mm/memory_hotplug.cmodified+40−106View file
mm/mempolicy.cmodified+22−13View file
mm/migrate.cmodified+25−19View file
mm/mmap.cmodified+74−22View file
mm/mmu_notifier.cmodified+0−31View file
mm/mremap.cmodified+16−4View file
mm/nommu.cmodified+2−4View file
mm/page-writeback.cmodified+15−18View file
mm/page_alloc.cmodified+230−132View file
mm/page_io.cmodified+3−3View file
mm/slab.cmodified+6−2View file
mm/slab_common.cmodified+68−47View file
mm/slub.cmodified+58−25View file
mm/sparse.cmodified+1−3View file
mm/swap.cmodified+0−1View file
mm/swap_state.cmodified+1−0View file
mm/swapfile.cmodified+38−45View file
mm/util.cmodified+2−3View file
mm/vmalloc.cmodified+4−0View file
mm/vmscan.cmodified+26−5View file
mm/vmstat.cmodified+5−5View file
mm/workingset.cmodified+89−46View file
mm/zsmalloc.cmodified+1−1View file
scripts/tags.shmodified+1−1View file
tools/accounting/getdelays.cmodified+7−1View file
tools/testing/selftests/vm/.gitignoremodified+1−0View file
tools/testing/selftests/vm/Makefilemodified+1−0View file
tools/testing/selftests/vm/gup_benchmark.cmodified+35−7View file
tools/testing/selftests/vm/map_fixed_noreplace.cadded+206−0View file
tools/testing/selftests/vm/userfaultfd.cmodified+77−57View file
virt/kvm/kvm_main.cmodified+0−1View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/accounting/psi.txt

View file
diff --git a/Documentation/accounting/psi.txt b/Documentation/accounting/psi.txt
new file mode 100644
index 0000000..b8ca28b
--- /dev/null
+++ b/Documentation/accounting/psi.txt
@@ -0,0 +1,73 @@
+================================
+PSI - Pressure Stall Information
+================================
+
+:Date: April, 2018
+:Author: Johannes Weiner <[email protected]>
+
+When CPU, memory or IO devices are contended, workloads experience
+latency spikes, throughput losses, and run the risk of OOM kills.
+
+Without an accurate measure of such contention, users are forced to
+either play it safe and under-utilize their hardware resources, or
+roll the dice and frequently suffer the disruptions resulting from
+excessive overcommit.
+
+The psi feature identifies and quantifies the disruptions caused by
+such resource crunches and the time impact it has on complex workloads
+or even entire systems.
+
+Having an accurate measure of productivity losses caused by resource
+scarcity aids users in sizing workloads to hardware--or provisioning
+hardware according to workload demand.
+
+As psi aggregates this information in realtime, systems can be managed
+dynamically using techniques such as load shedding, migrating jobs to
+other systems or data centers, or strategically pausing or killing low
+priority or restartable batch jobs.
+
+This allows maximizing hardware utilization without sacrificing
+workload health or risking major disruptions such as OOM kills.
+
+Pressure interface
+==================
+
+Pressure information for each resource is exported through the
+respective file in /proc/pressure/ -- cpu, memory, and io.
+
+The format for CPU is as such:
+
+some avg10=0.00 avg60=0.00 avg300=0.00 total=0
+
+and for memory and IO:
+
+some avg10=0.00 avg60=0.00 avg300=0.00 total=0
+full avg10=0.00 avg60=0.00 avg300=0.00 total=0
+
+The "some" line indicates the share of time in which at least some
+tasks are stalled on a given resource.
+
+The "full" line indicates the share of time in which all non-idle
+tasks are stalled on a given resource simultaneously. In this state
+actual CPU cycles are going to waste, and a workload that spends
+extended time in this state is considered to be thrashing. This has
+severe impact on performance, and it's useful to distinguish this
+situation from a state where some tasks are stalled but the CPU is
+still doing productive work. As such, time spent in this subset of the
+stall state is tracked separately and exported in the "full" averages.
+
+The ratios are tracked as recent trends over ten, sixty, and three
+hundred second windows, which gives insight into short term events as
+well as medium and long term trends. The total absolute stall time is
+tracked and exported as well, to allow detection of latency spikes
+which wouldn't necessarily make a dent in the time averages, or to
+average trends over custom time frames.
+
+Cgroup2 interface
+=================
+
+In a system with a CONFIG_CGROUP=y kernel and the cgroup2 filesystem
+mounted, pressure stall information is also tracked for tasks grouped
+into cgroups. Each subdirectory in the cgroupfs mountpoint contains
+cpu.pressure, memory.pressure, and io.pressure files; the format is
+the same as the /proc/pressure/ files.

Documentation/admin-guide/cgroup-v2.rst

View file
diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index caf3610..8384c68 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -966,6 +966,12 @@ All time durations are in microseconds.
$PERIOD duration. "max" for $MAX indicates no limit. If only
one number is written, $MAX is updated.
+ cpu.pressure
+ A read-only nested-key file which exists on non-root cgroups.
+
+ Shows pressure stall information for CPU. See
+ Documentation/accounting/psi.txt for details.
+
Memory
------
@@ -1127,6 +1133,10 @@ PAGE_SIZE multiple when read back.
disk readahead. For now OOM in memory cgroup kills
tasks iff shortage has happened inside page fault.
+ This event is not raised if the OOM killer is not
+ considered as an option, e.g. for failed high-order
+ allocations.
+
oom_kill
The number of processes belonging to this cgroup
killed by any kind of OOM killer.
@@ -1271,6 +1281,12 @@ PAGE_SIZE multiple when read back.
higher than the limit for an extended period of time. This
reduces the impact on the workload and memory management.
+ memory.pressure
+ A read-only nested-key file which exists on non-root cgroups.
+
+ Shows pressure stall information for memory. See
+ Documentation/accounting/psi.txt for details.
+
Usage Guidelines
~~~~~~~~~~~~~~~~
@@ -1408,6 +1424,12 @@ IO Interface Files
8:16 rbps=2097152 wbps=max riops=max wiops=max
+ io.pressure
+ A read-only nested-key file which exists on non-root cgroups.
+
+ Shows pressure stall information for IO. See
+ Documentation/accounting/psi.txt for details.
+
Writeback
~~~~~~~~~

Documentation/admin-guide/kernel-parameters.txt

View file
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 47ca5cd..b90fe3b 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4851,6 +4851,18 @@
This is actually a boot loader parameter; the value is
passed to the kernel using a special protocol.
+ vm_debug[=options] [KNL] Available with CONFIG_DEBUG_VM=y.
+ May slow down system boot speed, especially when
+ enabled on systems with a large amount of memory.
+ All options are enabled by default, and this
+ interface is meant to allow for selectively
+ enabling or disabling specific virtual memory
+ debugging features.
+
+ Available options are:
+ P Enable page structure init time poisoning
+ - Disable all of the above options
+
vmalloc=nn[KMG] [KNL,BOOT] Forces the vmalloc area to have an exact
size of <nn>. This can be used to increase the
minimum size (128MB on x86). It can also be used to

Documentation/filesystems/proc.txt

View file
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index 22b4b00..12a5e6e 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -858,6 +858,7 @@ Writeback: 0 kB
AnonPages: 861800 kB
Mapped: 280372 kB
Shmem: 644 kB
+KReclaimable: 168048 kB
Slab: 284364 kB
SReclaimable: 159856 kB
SUnreclaim: 124508 kB
@@ -925,6 +926,9 @@ AnonHugePages: Non-file backed huge pages mapped into userspace page tables
ShmemHugePages: Memory used by shared memory (shmem) and tmpfs allocated
with huge pages
ShmemPmdMapped: Shared memory mapped into userspace with huge pages
+KReclaimable: Kernel allocations that the kernel will attempt to reclaim
+ under memory pressure. Includes SReclaimable (below), and other
+ direct allocations with a shrinker.
Slab: in-kernel data structures cache
SReclaimable: Part of Slab, that might be reclaimed, such as caches
SUnreclaim: Part of Slab, that cannot be reclaimed on memory pressure

Documentation/vm/slub.rst

View file
diff --git a/Documentation/vm/slub.rst b/Documentation/vm/slub.rst
index 3a775fd..1959288 100644
--- a/Documentation/vm/slub.rst
+++ b/Documentation/vm/slub.rst
@@ -36,9 +36,10 @@ debugging is enabled. Format:
slub_debug=<Debug-Options>
Enable options for all slabs
-slub_debug=<Debug-Options>,<slab name>
- Enable options only for select slabs
+slub_debug=<Debug-Options>,<slab name1>,<slab name2>,...
+ Enable options only for select slabs (no spaces
+ after a comma)
Possible debug options are::
@@ -62,7 +63,12 @@ Trying to find an issue in the dentry cache? Try::
slub_debug=,dentry
-to only enable debugging on the dentry cache.
+to only enable debugging on the dentry cache. You may use an asterisk at the
+end of the slab name, in order to cover all slabs with the same prefix. For
+example, here's how you can poison the dentry cache as well as all kmalloc
+slabs:
+
+ slub_debug=P,kmalloc-*,dentry
Red zoning and tracking may realign the slab. We can just apply sanity checks
to the dentry cache with::

Documentation/x86/pat.txt

View file
diff --git a/Documentation/x86/pat.txt b/Documentation/x86/pat.txt
index 2a4ee63..481d8d8 100644
--- a/Documentation/x86/pat.txt
+++ b/Documentation/x86/pat.txt
@@ -90,12 +90,12 @@ pci proc | -- | -- | WC |
Advanced APIs for drivers
-------------------------
A. Exporting pages to users with remap_pfn_range, io_remap_pfn_range,
-vm_insert_pfn
+vmf_insert_pfn
Drivers wanting to export some pages to userspace do it by using mmap
interface and a combination of
1) pgprot_noncached()
-2) io_remap_pfn_range() or remap_pfn_range() or vm_insert_pfn()
+2) io_remap_pfn_range() or remap_pfn_range() or vmf_insert_pfn()
With PAT support, a new API pgprot_writecombine is being added. So, drivers can
continue to use the above sequence, with either pgprot_noncached() or

arch/alpha/Kconfig

View file
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 5b4f883..620b0a7 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -31,6 +31,8 @@ config ALPHA
select ODD_RT_SIGACTION
select OLD_SIGSUSPEND
select CPU_NO_EFFICIENT_FFS if !ALPHA_EV67
+ select HAVE_MEMBLOCK
+ select NO_BOOTMEM
help
The Alpha is a 64-bit general-purpose processor designed and
marketed by the Digital Equipment Corporation of blessed memory,

arch/alpha/kernel/core_irongate.c

View file
diff --git a/arch/alpha/kernel/core_irongate.c b/arch/alpha/kernel/core_irongate.c
index aec7572..f709866 100644
--- a/arch/alpha/kernel/core_irongate.c
+++ b/arch/alpha/kernel/core_irongate.c
@@ -21,6 +21,7 @@
#include <linux/init.h>
#include <linux/initrd.h>
#include <linux/bootmem.h>
+#include <linux/memblock.h>
#include <asm/ptrace.h>
#include <asm/cacheflush.h>
@@ -241,8 +242,7 @@ albacore_init_arch(void)
size / 1024);
}
#endif
- reserve_bootmem_node(NODE_DATA(0), pci_mem, memtop -
- pci_mem, BOOTMEM_DEFAULT);
+ memblock_reserve(pci_mem, memtop - pci_mem);
printk("irongate_init_arch: temporarily reserving "
"region %08lx-%08lx for PCI\n", pci_mem, memtop - 1);
}

arch/alpha/kernel/setup.c

View file
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index 5576f76..4f0d944 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -30,6 +30,7 @@
#include <linux/ioport.h>
#include <linux/platform_device.h>
#include <linux/bootmem.h>
+#include <linux/memblock.h>
#include <linux/pci.h>
#include <linux/seq_file.h>
#include <linux/root_dev.h>
@@ -312,9 +313,7 @@ setup_memory(void *kernel_end)
{
struct memclust_struct * cluster;
struct memdesc_struct * memdesc;
- unsigned long start_kernel_pfn, end_kernel_pfn;
- unsigned long bootmap_size, bootmap_pages, bootmap_start;
- unsigned long start, end;
+ unsigned long kernel_size;
unsigned long i;
/* Find free clusters, and init and free the bootmem accordingly. */
@@ -322,6 +321,8 @@ setup_memory(void *kernel_end)
(hwrpb->mddt_offset + (unsigned long) hwrpb);
for_each_mem_cluster(memdesc, cluster, i) {
+ unsigned long end;
+
printk("memcluster %lu, usage %01lx, start %8lu, end %8lu\n",
i, cluster->usage, cluster->start_pfn,
cluster->start_pfn + cluster->numpages);
@@ -335,6 +336,9 @@ setup_memory(void *kernel_end)
end = cluster->start_pfn + cluster->numpages;
if (end > max_low_pfn)
max_low_pfn = end;
+
+ memblock_add(PFN_PHYS(cluster->start_pfn),
+ cluster->numpages << PAGE_SHIFT);
}
/*
@@ -363,87 +367,9 @@ setup_memory(void *kernel_end)
max_low_pfn = mem_size_limit;
}
- /* Find the bounds of kernel memory. */
- start_kernel_pfn = PFN_DOWN(KERNEL_START_PHYS);
- end_kernel_pfn = PFN_UP(virt_to_phys(kernel_end));
- bootmap_start = -1;
-
- try_again:
- if (max_low_pfn <= end_kernel_pfn)
- panic("not enough memory to boot");
-
- /* We need to know how many physically contiguous pages
- we'll need for the bootmap. */
- bootmap_pages = bootmem_bootmap_pages(max_low_pfn);
-
- /* Now find a good region where to allocate the bootmap. */
- for_each_mem_cluster(memdesc, cluster, i) {
- if (cluster->usage & 3)
- continue;
-
- start = cluster->start_pfn;
- end = start + cluster->numpages;
- if (start >= max_low_pfn)
- continue;
- if (end > max_low_pfn)
- end = max_low_pfn;
- if (start < start_kernel_pfn) {
- if (end > end_kernel_pfn
- && end - end_kernel_pfn >= bootmap_pages) {
- bootmap_start = end_kernel_pfn;
- break;
- } else if (end > start_kernel_pfn)
- end = start_kernel_pfn;
- } else if (start < end_kernel_pfn)
- start = end_kernel_pfn;
- if (end - start >= bootmap_pages) {
- bootmap_start = start;
- break;
- }
- }
-
- if (bootmap_start == ~0UL) {
- max_low_pfn >>= 1;
- goto try_again;
- }
-
- /* Allocate the bootmap and mark the whole MM as reserved. */
- bootmap_size = init_bootmem(bootmap_start, max_low_pfn);
-
- /* Mark the free regions. */
- for_each_mem_cluster(memdesc, cluster, i) {
- if (cluster->usage & 3)
- continue;
-
- start = cluster->start_pfn;
- end = cluster->start_pfn + cluster->numpages;
- if (start >= max_low_pfn)
- continue;
- if (end > max_low_pfn)
- end = max_low_pfn;
- if (start < start_kernel_pfn) {
- if (end > end_kernel_pfn) {
- free_bootmem(PFN_PHYS(start),
- (PFN_PHYS(start_kernel_pfn)
- - PFN_PHYS(start)));
- printk("freeing pages %ld:%ld\n",
- start, start_kernel_pfn);
- start = end_kernel_pfn;
- } else if (end > start_kernel_pfn)
- end = start_kernel_pfn;
- } else if (start < end_kernel_pfn)
- start = end_kernel_pfn;
- if (start >= end)
- continue;
-
- free_bootmem(PFN_PHYS(start), PFN_PHYS(end) - PFN_PHYS(start));
- printk("freeing pages %ld:%ld\n", start, end);
- }
-
- /* Reserve the bootmap memory. */
- reserve_bootmem(PFN_PHYS(bootmap_start), bootmap_size,
- BOOTMEM_DEFAULT);
- printk("reserving pages %ld:%ld\n", bootmap_start, bootmap_start+PFN_UP(bootmap_size));
+ /* Reserve the kernel memory. */
+ kernel_size = virt_to_phys(kernel_end) - KERNEL_START_PHYS;
+ memblock_reserve(KERNEL_START_PHYS, kernel_size);
#ifdef CONFIG_BLK_DEV_INITRD
initrd_start = INITRD_START;
@@ -459,8 +385,8 @@ setup_memory(void *kernel_end)
initrd_end,
phys_to_virt(PFN_PHYS(max_low_pfn)));
} else {
- reserve_bootmem(virt_to_phys((void *)initrd_start),
- INITRD_SIZE, BOOTMEM_DEFAULT);
+ memblock_reserve(virt_to_phys((void *)initrd_start),
+ INITRD_SIZE);
}
}
#endif /* CONFIG_BLK_DEV_INITRD */

arch/alpha/mm/numa.c

View file
diff --git a/arch/alpha/mm/numa.c b/arch/alpha/mm/numa.c
index a9e8647..26cd925 100644
--- a/arch/alpha/mm/numa.c
+++ b/arch/alpha/mm/numa.c
@@ -11,6 +11,7 @@
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/bootmem.h>
+#include <linux/memblock.h>
#include <linux/swap.h>
#include <linux/initrd.h>
#include <linux/pfn.h>
@@ -59,12 +60,10 @@ setup_memory_node(int nid, void *kernel_end)
struct memclust_struct * cluster;
struct memdesc_struct * memdesc;
unsigned long start_kernel_pfn, end_kernel_pfn;
- unsigned long bootmap_size, bootmap_pages, bootmap_start;
unsigned long start, end;
unsigned long node_pfn_start, node_pfn_end;
unsigned long node_min_pfn, node_max_pfn;
int i;
- unsigned long node_datasz = PFN_UP(sizeof(pg_data_t));
int show_init = 0;
/* Find the bounds of current node */
@@ -134,24 +133,14 @@ setup_memory_node(int nid, void *kernel_end)
/* Cute trick to make sure our local node data is on local memory */
node_data[nid] = (pg_data_t *)(__va(node_min_pfn << PAGE_SHIFT));
#endif
- /* Quasi-mark the pg_data_t as in-use */
- node_min_pfn += node_datasz;
- if (node_min_pfn >= node_max_pfn) {
- printk(" not enough mem to reserve NODE_DATA");
- return;
- }
- NODE_DATA(nid)->bdata = &bootmem_node_data[nid];
-
printk(" Detected node memory: start %8lu, end %8lu\n",
node_min_pfn, node_max_pfn);
DBGDCONT(" DISCONTIG: node_data[%d] is at 0x%p\n", nid, NODE_DATA(nid));
- DBGDCONT(" DISCONTIG: NODE_DATA(%d)->bdata is at 0x%p\n", nid, NODE_DATA(nid)->bdata);
/* Find the bounds of kernel memory. */
start_kernel_pfn = PFN_DOWN(KERNEL_START_PHYS);
end_kernel_pfn = PFN_UP(virt_to_phys(kernel_end));
- bootmap_start = -1;
if (!nid && (node_max_pfn < end_kernel_pfn || node_min_pfn > start_kernel_pfn))
panic("kernel loaded out of ram");
@@ -161,89 +150,11 @@ setup_memory_node(int nid, void *kernel_end)
has much larger alignment than 8Mb, so it's safe. */
node_min_pfn &= ~((1UL << (MAX_ORDER-1))-1);
- /* We need to know how many physically contiguous pages
- we'll need for the bootmap. */
- bootmap_pages = bootmem_bootmap_pages(node_max_pfn-node_min_pfn);
-
- /* Now find a good region where to allocate the bootmap. */
- for_each_mem_cluster(memdesc, cluster, i) {
- if (cluster->usage & 3)
- continue;
-
- start = cluster->start_pfn;
- end = start + cluster->numpages;
-
- if (start >= node_max_pfn || end <= node_min_pfn)
- continue;
-
- if (end > node_max_pfn)
- end = node_max_pfn;
- if (start < node_min_pfn)
- start = node_min_pfn;
-
- if (start < start_kernel_pfn) {
- if (end > end_kernel_pfn
- && end - end_kernel_pfn >= bootmap_pages) {
- bootmap_start = end_kernel_pfn;
- break;
- } else if (end > start_kernel_pfn)
- end = start_kernel_pfn;
- } else if (start < end_kernel_pfn)
- start = end_kernel_pfn;
- if (end - start >= bootmap_pages) {
- bootmap_start = start;
- break;
- }
- }
-
- if (bootmap_start == -1)
- panic("couldn't find a contiguous place for the bootmap");
-
- /* Allocate the bootmap and mark the whole MM as reserved. */
- bootmap_size = init_bootmem_node(NODE_DATA(nid), bootmap_start,
- node_min_pfn, node_max_pfn);
- DBGDCONT(" bootmap_start %lu, bootmap_size %lu, bootmap_pages %lu\n",
- bootmap_start, bootmap_size, bootmap_pages);
+ memblock_add(PFN_PHYS(node_min_pfn),
+ (node_max_pfn - node_min_pfn) << PAGE_SHIFT);
- /* Mark the free regions. */
- for_each_mem_cluster(memdesc, cluster, i) {
- if (cluster->usage & 3)
- continue;
-
- start = cluster->start_pfn;
- end = cluster->start_pfn + cluster->numpages;
-
- if (start >= node_max_pfn || end <= node_min_pfn)
- continue;
-
- if (end > node_max_pfn)
- end = node_max_pfn;
- if (start < node_min_pfn)
- start = node_min_pfn;
-
- if (start < start_kernel_pfn) {
- if (end > end_kernel_pfn) {
- free_bootmem_node(NODE_DATA(nid), PFN_PHYS(start),
- (PFN_PHYS(start_kernel_pfn)
- - PFN_PHYS(start)));
- printk(" freeing pages %ld:%ld\n",
- start, start_kernel_pfn);
- start = end_kernel_pfn;
- } else if (end > start_kernel_pfn)
- end = start_kernel_pfn;
- } else if (start < end_kernel_pfn)
- start = end_kernel_pfn;
- if (start >= end)
- continue;
-
- free_bootmem_node(NODE_DATA(nid), PFN_PHYS(start), PFN_PHYS(end) - PFN_PHYS(start));
- printk(" freeing pages %ld:%ld\n", start, end);
- }
-
- /* Reserve the bootmap memory. */
- reserve_bootmem_node(NODE_DATA(nid), PFN_PHYS(bootmap_start),
- bootmap_size, BOOTMEM_DEFAULT);
- printk(" reserving pages %ld:%ld\n", bootmap_start, bootmap_start+PFN_UP(bootmap_size));
+ NODE_DATA(nid)->node_start_pfn = node_min_pfn;
+ NODE_DATA(nid)->node_present_pages = node_max_pfn - node_min_pfn;
node_set_online(nid);
}
@@ -251,6 +162,7 @@ setup_memory_node(int nid, void *kernel_end)
void __init
setup_memory(void *kernel_end)
{
+ unsigned long kernel_size;
int nid;
show_mem_layout();
@@ -262,6 +174,9 @@ setup_memory(void *kernel_end)
for (nid = 0; nid < MAX_NUMNODES; nid++)
setup_memory_node(nid, kernel_end);
+ kernel_size = virt_to_phys(kernel_end) - KERNEL_START_PHYS;
+ memblock_reserve(KERNEL_START_PHYS, kernel_size);
+
#ifdef CONFIG_BLK_DEV_INITRD
initrd_start = INITRD_START;
if (initrd_start) {
@@ -279,9 +194,8 @@ setup_memory(void *kernel_end)
phys_to_virt(PFN_PHYS(max_low_pfn)));
} else {
nid = kvaddr_to_nid(initrd_start);
- reserve_bootmem_node(NODE_DATA(nid),
- virt_to_phys((void *)initrd_start),
- INITRD_SIZE, BOOTMEM_DEFAULT);
+ memblock_reserve(virt_to_phys((void *)initrd_start),
+ INITRD_SIZE);
}
}
#endif /* CONFIG_BLK_DEV_INITRD */
@@ -303,9 +217,8 @@ void __init paging_init(void)
dma_local_pfn = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
for_each_online_node(nid) {
- bootmem_data_t *bdata = &bootmem_node_data[nid];
- unsigned long start_pfn = bdata->node_min_pfn;
- unsigned long end_pfn = bdata->node_low_pfn;
+ unsigned long start_pfn = NODE_DATA(nid)->node_start_pfn;
+ unsigned long end_pfn = start_pfn + NODE_DATA(nid)->node_present_pages;
if (dma_local_pfn >= end_pfn - start_pfn)
zones_size[ZONE_DMA] = end_pfn - start_pfn;

arch/arm/include/asm/hugetlb-3level.h

View file
diff --git a/arch/arm/include/asm/hugetlb-3level.h b/arch/arm/include/asm/hugetlb-3level.h
index d4014fb..0d9f391 100644
--- a/arch/arm/include/asm/hugetlb-3level.h
+++ b/arch/arm/include/asm/hugetlb-3level.h
@@ -29,6 +29,7 @@
* ptes.
* (The valid bit is automatically cleared by set_pte_at for PROT_NONE ptes).

This diff is incomplete. Download the complete patch.

arch/arm/include/asm/hugetlb.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/hugetlb.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/include/asm/string.h

View file

This diff is incomplete. Download the complete patch.

arch/arm64/kernel/arm64ksyms.c

View file

This diff is incomplete. Download the complete patch.

arch/arm64/lib/memchr.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/lib/memcmp.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/lib/strchr.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/lib/strcmp.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/lib/strlen.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/lib/strncmp.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/lib/strnlen.S

View file

This diff is incomplete. Download the complete patch.

arch/arm64/lib/strrchr.S

View file

This diff is incomplete. Download the complete patch.

arch/hexagon/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/hexagon/mm/init.c

View file

This diff is incomplete. Download the complete patch.

arch/ia64/include/asm/hugetlb.h

View file

This diff is incomplete. Download the complete patch.

arch/ia64/include/asm/pgtable.h

View file

This diff is incomplete. Download the complete patch.

arch/mips/include/asm/hugetlb.h

View file

This diff is incomplete. Download the complete patch.

arch/nios2/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/nios2/kernel/prom.c

View file

This diff is incomplete. Download the complete patch.

arch/nios2/kernel/setup.c

View file

This diff is incomplete. Download the complete patch.

arch/parisc/include/asm/hugetlb.h

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/include/asm/book3s/32/pgtable.h

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/include/asm/book3s/64/pgtable.h

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/include/asm/hugetlb.h

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/include/asm/nohash/32/pgtable.h

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/include/asm/nohash/64/pgtable.h

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/platforms/cell/cpufreq_spudemand.c

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/platforms/cell/spufs/sched.c

View file

This diff is incomplete. Download the complete patch.

arch/s390/appldata/appldata_os.c

View file

This diff is incomplete. Download the complete patch.

arch/sh/include/asm/hugetlb.h

View file

This diff is incomplete. Download the complete patch.

arch/sparc/include/asm/hugetlb.h

View file

This diff is incomplete. Download the complete patch.

arch/um/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/um/kernel/physmem.c

View file

This diff is incomplete. Download the complete patch.

arch/unicore32/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/unicore32/mm/init.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/entry/vdso/vma.c

View file

This diff is incomplete. Download the complete patch.

arch/x86/include/asm/hugetlb.h

View file

This diff is incomplete. Download the complete patch.

arch/x86/kernel/e820.c

View file

This diff is incomplete. Download the complete patch.

arch/xtensa/include/asm/Kbuild

View file

This diff is incomplete. Download the complete patch.

arch/xtensa/include/asm/vga.h

View before deletion

This diff is incomplete. Download the complete patch.

block/blk-iolatency.c

View file

This diff is incomplete. Download the complete patch.

drivers/base/node.c

View file

This diff is incomplete. Download the complete patch.

drivers/cpuidle/governors/menu.c

View file

This diff is incomplete. Download the complete patch.

drivers/infiniband/hw/hfi1/mmu_rb.c

View file

This diff is incomplete. Download the complete patch.

drivers/iommu/amd_iommu_v2.c

View file

This diff is incomplete. Download the complete patch.

drivers/iommu/intel-svm.c

View file

This diff is incomplete. Download the complete patch.

drivers/misc/sgi-gru/grutlbpurge.c

View file

This diff is incomplete. Download the complete patch.

drivers/of/fdt.c

View file

This diff is incomplete. Download the complete patch.

drivers/staging/android/ion/ion_page_pool.c

View file

This diff is incomplete. Download the complete patch.

fs/cramfs/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/dcache.c

View file

This diff is incomplete. Download the complete patch.

fs/iomap.c

View file

This diff is incomplete. Download the complete patch.

fs/kernfs/mount.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/alloc.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/aops.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/dlm/dlmdebug.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/dlm/dlmthread.c

View file

This diff is incomplete. Download the complete patch.

fs/ocfs2/refcounttree.c

View file

This diff is incomplete. Download the complete patch.

fs/proc/inode.c

View file

This diff is incomplete. Download the complete patch.

fs/proc/loadavg.c

View file

This diff is incomplete. Download the complete patch.

fs/proc/meminfo.c

View file

This diff is incomplete. Download the complete patch.

fs/proc/task_mmu.c

View file

This diff is incomplete. Download the complete patch.

fs/userfaultfd.c

View file

This diff is incomplete. Download the complete patch.

include/asm-generic/hugetlb.h

View file

This diff is incomplete. Download the complete patch.

include/asm-generic/pgtable.h

View file

This diff is incomplete. Download the complete patch.

include/linux/cgroup-defs.h

View file

This diff is incomplete. Download the complete patch.

include/linux/cgroup.h

View file

This diff is incomplete. Download the complete patch.

include/linux/delayacct.h

View file

This diff is incomplete. Download the complete patch.

include/linux/hmm.h

View file

This diff is incomplete. Download the complete patch.

include/linux/huge_mm.h

View file

This diff is incomplete. Download the complete patch.

include/linux/iomap.h

View file

This diff is incomplete. Download the complete patch.

include/linux/linkage.h

View file

This diff is incomplete. Download the complete patch.

include/linux/math64.h

View file

This diff is incomplete. Download the complete patch.

include/linux/memblock.h

View file

This diff is incomplete. Download the complete patch.

include/linux/memcontrol.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mm.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mmu_notifier.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mmzone.h

View file

This diff is incomplete. Download the complete patch.

include/linux/page-flags.h

View file

This diff is incomplete. Download the complete patch.

include/linux/pfn_t.h

View file

This diff is incomplete. Download the complete patch.

include/linux/psi.h

View file

This diff is incomplete. Download the complete patch.

include/linux/psi_types.h

View file

This diff is incomplete. Download the complete patch.

include/linux/sched.h

View file

This diff is incomplete. Download the complete patch.

include/linux/sched/loadavg.h

View file

This diff is incomplete. Download the complete patch.

include/linux/slab.h

View file

This diff is incomplete. Download the complete patch.

include/linux/swap.h

View file

This diff is incomplete. Download the complete patch.

include/trace/events/mmflags.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/linux/taskstats.h

View file

This diff is incomplete. Download the complete patch.

init/Kconfig

View file

This diff is incomplete. Download the complete patch.

kernel/cgroup/cgroup.c

View file

This diff is incomplete. Download the complete patch.

kernel/debug/kdb/kdb_main.c

View file

This diff is incomplete. Download the complete patch.

kernel/delayacct.c

View file

This diff is incomplete. Download the complete patch.

kernel/fork.c

View file

This diff is incomplete. Download the complete patch.

kernel/memremap.c

View file

This diff is incomplete. Download the complete patch.

kernel/sched/Makefile

View file

This diff is incomplete. Download the complete patch.

kernel/sched/core.c

View file

This diff is incomplete. Download the complete patch.

kernel/sched/loadavg.c

View file

This diff is incomplete. Download the complete patch.

kernel/sched/psi.c

View file

This diff is incomplete. Download the complete patch.

kernel/sched/sched.h

View file

This diff is incomplete. Download the complete patch.

kernel/sched/stats.h

View file

This diff is incomplete. Download the complete patch.

lib/test_kasan.c

View file

This diff is incomplete. Download the complete patch.

mm/compaction.c

View file

This diff is incomplete. Download the complete patch.

mm/debug.c

View file

This diff is incomplete. Download the complete patch.

mm/filemap.c

View file

This diff is incomplete. Download the complete patch.

mm/gup.c

View file

This diff is incomplete. Download the complete patch.

mm/gup_benchmark.c

View file

This diff is incomplete. Download the complete patch.

mm/hmm.c

View file

This diff is incomplete. Download the complete patch.

mm/huge_memory.c

View file

This diff is incomplete. Download the complete patch.

mm/hugetlb.c

View file

This diff is incomplete. Download the complete patch.

mm/kasan/quarantine.c

View file

This diff is incomplete. Download the complete patch.

mm/kmemleak.c

View file

This diff is incomplete. Download the complete patch.

mm/memblock.c

View file

This diff is incomplete. Download the complete patch.

mm/memcontrol.c

View file

This diff is incomplete. Download the complete patch.

mm/memory.c

View file

This diff is incomplete. Download the complete patch.

mm/memory_hotplug.c

View file

This diff is incomplete. Download the complete patch.

mm/mempolicy.c

View file

This diff is incomplete. Download the complete patch.

mm/migrate.c

View file

This diff is incomplete. Download the complete patch.

mm/mmap.c

View file

This diff is incomplete. Download the complete patch.

mm/mmu_notifier.c

View file

This diff is incomplete. Download the complete patch.

mm/mremap.c

View file

This diff is incomplete. Download the complete patch.

mm/nommu.c

View file

This diff is incomplete. Download the complete patch.

mm/page-writeback.c

View file

This diff is incomplete. Download the complete patch.

mm/page_alloc.c

View file

This diff is incomplete. Download the complete patch.

mm/page_io.c

View file

This diff is incomplete. Download the complete patch.

mm/slab.c

View file

This diff is incomplete. Download the complete patch.

mm/slab_common.c

View file

This diff is incomplete. Download the complete patch.

mm/slub.c

View file

This diff is incomplete. Download the complete patch.

mm/sparse.c

View file

This diff is incomplete. Download the complete patch.

mm/swap.c

View file

This diff is incomplete. Download the complete patch.

mm/swap_state.c

View file

This diff is incomplete. Download the complete patch.

mm/swapfile.c

View file

This diff is incomplete. Download the complete patch.

mm/util.c

View file

This diff is incomplete. Download the complete patch.

mm/vmalloc.c

View file

This diff is incomplete. Download the complete patch.

mm/vmscan.c

View file

This diff is incomplete. Download the complete patch.

mm/vmstat.c

View file

This diff is incomplete. Download the complete patch.

mm/workingset.c

View file

This diff is incomplete. Download the complete patch.

mm/zsmalloc.c

View file

This diff is incomplete. Download the complete patch.

scripts/tags.sh

View file

This diff is incomplete. Download the complete patch.

tools/accounting/getdelays.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/vm/.gitignore

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/vm/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/vm/gup_benchmark.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/vm/map_fixed_noreplace.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/vm/userfaultfd.c

View file

This diff is incomplete. Download the complete patch.

virt/kvm/kvm_main.c

View file

This diff is incomplete. Download the complete patch.