Skip to content

Commit 1dcf58d

Browse files
committed
Merge branch 'akpm' (patches from Andrew)
Merge first patchbomb from Andrew Morton: - arch/sh updates - ocfs2 updates - kernel/watchdog feature - about half of mm/ * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (122 commits) Documentation: update arch list in the 'memtest' entry Kconfig: memtest: update number of test patterns up to 17 arm: add support for memtest arm64: add support for memtest memtest: use phys_addr_t for physical addresses mm: move memtest under mm mm, hugetlb: abort __get_user_pages if current has been oom killed mm, mempool: do not allow atomic resizing memcg: print cgroup information when system panics due to panic_on_oom mm: numa: remove migrate_ratelimited mm: fold arch_randomize_brk into ARCH_HAS_ELF_RANDOMIZE mm: split ET_DYN ASLR from mmap ASLR s390: redefine randomize_et_dyn for ELF_ET_DYN_BASE mm: expose arch_mmap_rnd when available s390: standardize mmap_rnd() usage powerpc: standardize mmap_rnd() usage mips: extract logic for mmap_rnd() arm64: standardize mmap_rnd() usage x86: standardize mmap_rnd() usage arm: factor out mmap ASLR into mmap_rnd ...
2 parents 80dcc31 + e4b0db7 commit 1dcf58d

153 files changed

Lines changed: 2312 additions & 1419 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.

‎Documentation/cma/debugfs.txt‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The CMA debugfs interface is useful to retrieve basic information out of the
2+
different CMA areas and to test allocation/release in each of the areas.
3+
4+
Each CMA zone represents a directory under <debugfs>/cma/, indexed by the
5+
kernel's CMA index. So the first CMA zone would be:
6+
7+
<debugfs>/cma/cma-0
8+
9+
The structure of the files created under that directory is as follows:
10+
11+
- [RO] base_pfn: The base PFN (Page Frame Number) of the zone.
12+
- [RO] count: Amount of memory in the CMA area.
13+
- [RO] order_per_bit: Order of pages represented by one bit.
14+
- [RO] bitmap: The bitmap of page states in the zone.
15+
- [WO] alloc: Allocate N pages from that CMA area. For example:
16+
17+
echo 5 > <debugfs>/cma/cma-2/alloc
18+
19+
would try to allocate 5 pages from the cma-2 area.
20+
21+
- [WO] free: Free N pages from that CMA area, similar to the above.

‎Documentation/kernel-parameters.txt‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,7 +1989,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
19891989
seconds. Use this parameter to check at some
19901990
other rate. 0 disables periodic checking.
19911991

1992-
memtest= [KNL,X86] Enable memtest
1992+
memtest= [KNL,X86,ARM] Enable memtest
19931993
Format: <integer>
19941994
default : 0 <disable>
19951995
Specifies the number of memtest passes to be
@@ -2236,8 +2236,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
22362236

22372237
nmi_watchdog= [KNL,BUGS=X86] Debugging features for SMP kernels
22382238
Format: [panic,][nopanic,][num]
2239-
Valid num: 0
2239+
Valid num: 0 or 1
22402240
0 - turn nmi_watchdog off
2241+
1 - turn nmi_watchdog on
22412242
When panic is specified, panic when an NMI watchdog
22422243
timeout occurs (or 'nopanic' to override the opposite
22432244
default).
@@ -2322,6 +2323,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
23222323
register save and restore. The kernel will only save
23232324
legacy floating-point registers on task switch.
23242325

2326+
nohugeiomap [KNL,x86] Disable kernel huge I/O mappings.
2327+
23252328
noxsave [BUGS=X86] Disables x86 extended register state save
23262329
and restore using xsave. The kernel will fallback to
23272330
enabling legacy floating-point and sse state.
@@ -2464,7 +2467,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
24642467

24652468
nousb [USB] Disable the USB subsystem
24662469

2467-
nowatchdog [KNL] Disable the lockup detector (NMI watchdog).
2470+
nowatchdog [KNL] Disable both lockup detectors, i.e.
2471+
soft-lockup and NMI watchdog (hard-lockup).
24682472

24692473
nowb [ARM]
24702474

‎Documentation/sysctl/kernel.txt‎

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,14 @@ show up in /proc/sys/kernel:
7777
- shmmax [ sysv ipc ]
7878
- shmmni
7979
- softlockup_all_cpu_backtrace
80+
- soft_watchdog
8081
- stop-a [ SPARC only ]
8182
- sysrq ==> Documentation/sysrq.txt
8283
- sysctl_writes_strict
8384
- tainted
8485
- threads-max
8586
- unknown_nmi_panic
87+
- watchdog
8688
- watchdog_thresh
8789
- version
8890

@@ -417,16 +419,23 @@ successful IPC object allocation.
417419

418420
nmi_watchdog:
419421

420-
Enables/Disables the NMI watchdog on x86 systems. When the value is
421-
non-zero the NMI watchdog is enabled and will continuously test all
422-
online cpus to determine whether or not they are still functioning
423-
properly. Currently, passing "nmi_watchdog=" parameter at boot time is
424-
required for this function to work.
422+
This parameter can be used to control the NMI watchdog
423+
(i.e. the hard lockup detector) on x86 systems.
425424

426-
If LAPIC NMI watchdog method is in use (nmi_watchdog=2 kernel
427-
parameter), the NMI watchdog shares registers with oprofile. By
428-
disabling the NMI watchdog, oprofile may have more registers to
429-
utilize.
425+
0 - disable the hard lockup detector
426+
1 - enable the hard lockup detector
427+
428+
The hard lockup detector monitors each CPU for its ability to respond to
429+
timer interrupts. The mechanism utilizes CPU performance counter registers
430+
that are programmed to generate Non-Maskable Interrupts (NMIs) periodically
431+
while a CPU is busy. Hence, the alternative name 'NMI watchdog'.
432+
433+
The NMI watchdog is disabled by default if the kernel is running as a guest
434+
in a KVM virtual machine. This default can be overridden by adding
435+
436+
nmi_watchdog=1
437+
438+
to the guest kernel command line (see Documentation/kernel-parameters.txt).
430439

431440
==============================================================
432441

@@ -816,6 +825,22 @@ NMI.
816825

817826
==============================================================
818827

828+
soft_watchdog
829+
830+
This parameter can be used to control the soft lockup detector.
831+
832+
0 - disable the soft lockup detector
833+
1 - enable the soft lockup detector
834+
835+
The soft lockup detector monitors CPUs for threads that are hogging the CPUs
836+
without rescheduling voluntarily, and thus prevent the 'watchdog/N' threads
837+
from running. The mechanism depends on the CPUs ability to respond to timer
838+
interrupts which are needed for the 'watchdog/N' threads to be woken up by
839+
the watchdog timer function, otherwise the NMI watchdog - if enabled - can
840+
detect a hard lockup condition.
841+
842+
==============================================================
843+
819844
tainted:
820845

821846
Non-zero if the kernel has been tainted. Numeric values, which
@@ -858,6 +883,25 @@ example. If a system hangs up, try pressing the NMI switch.
858883

859884
==============================================================
860885

886+
watchdog:
887+
888+
This parameter can be used to disable or enable the soft lockup detector
889+
_and_ the NMI watchdog (i.e. the hard lockup detector) at the same time.
890+
891+
0 - disable both lockup detectors
892+
1 - enable both lockup detectors
893+
894+
The soft lockup detector and the NMI watchdog can also be disabled or
895+
enabled individually, using the soft_watchdog and nmi_watchdog parameters.
896+
If the watchdog parameter is read, for example by executing
897+
898+
cat /proc/sys/kernel/watchdog
899+
900+
the output of this command (0 or 1) shows the logical OR of soft_watchdog
901+
and nmi_watchdog.
902+
903+
==============================================================
904+
861905
watchdog_thresh:
862906

863907
This value can be used to control the frequency of hrtimer and NMI

‎Documentation/vm/cleancache.txt‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ IMPLEMENTATION OVERVIEW
2828
A cleancache "backend" that provides transcendent memory registers itself
2929
to the kernel's cleancache "frontend" by calling cleancache_register_ops,
3030
passing a pointer to a cleancache_ops structure with funcs set appropriately.
31-
Note that cleancache_register_ops returns the previous settings so that
32-
chaining can be performed if desired. The functions provided must conform to
33-
certain semantics as follows:
31+
The functions provided must conform to certain semantics as follows:
3432

3533
Most important, cleancache is "ephemeral". Pages which are copied into
3634
cleancache have an indefinite lifetime which is completely unknowable

‎Documentation/vm/unevictable-lru.txt‎

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ If the VMA passes some filtering as described in "Filtering Special Vmas"
317317
below, mlock_fixup() will attempt to merge the VMA with its neighbors or split
318318
off a subset of the VMA if the range does not cover the entire VMA. Once the
319319
VMA has been merged or split or neither, mlock_fixup() will call
320-
__mlock_vma_pages_range() to fault in the pages via get_user_pages() and to
320+
populate_vma_page_range() to fault in the pages via get_user_pages() and to
321321
mark the pages as mlocked via mlock_vma_page().
322322

323323
Note that the VMA being mlocked might be mapped with PROT_NONE. In this case,
@@ -327,7 +327,7 @@ fault path or in vmscan.
327327

328328
Also note that a page returned by get_user_pages() could be truncated or
329329
migrated out from under us, while we're trying to mlock it. To detect this,
330-
__mlock_vma_pages_range() checks page_mapping() after acquiring the page lock.
330+
populate_vma_page_range() checks page_mapping() after acquiring the page lock.
331331
If the page is still associated with its mapping, we'll go ahead and call
332332
mlock_vma_page(). If the mapping is gone, we just unlock the page and move on.
333333
In the worst case, this will result in a page mapped in a VM_LOCKED VMA
@@ -392,7 +392,7 @@ ignored for munlock.
392392

393393
If the VMA is VM_LOCKED, mlock_fixup() again attempts to merge or split off the
394394
specified range. The range is then munlocked via the function
395-
__mlock_vma_pages_range() - the same function used to mlock a VMA range -
395+
populate_vma_page_range() - the same function used to mlock a VMA range -
396396
passing a flag to indicate that munlock() is being performed.
397397

398398
Because the VMA access protections could have been changed to PROT_NONE after
@@ -402,7 +402,7 @@ get_user_pages() was enhanced to accept a flag to ignore the permissions when
402402
fetching the pages - all of which should be resident as a result of previous
403403
mlocking.
404404

405-
For munlock(), __mlock_vma_pages_range() unlocks individual pages by calling
405+
For munlock(), populate_vma_page_range() unlocks individual pages by calling
406406
munlock_vma_page(). munlock_vma_page() unconditionally clears the PG_mlocked
407407
flag using TestClearPageMlocked(). As with mlock_vma_page(),
408408
munlock_vma_page() use the Test*PageMlocked() function to handle the case where
@@ -463,21 +463,11 @@ populate the page table.
463463

464464
To mlock a range of memory under the unevictable/mlock infrastructure, the
465465
mmap() handler and task address space expansion functions call
466-
mlock_vma_pages_range() specifying the vma and the address range to mlock.
467-
mlock_vma_pages_range() filters VMAs like mlock_fixup(), as described above in
468-
"Filtering Special VMAs". It will clear the VM_LOCKED flag, which will have
469-
already been set by the caller, in filtered VMAs. Thus these VMA's need not be
470-
visited for munlock when the region is unmapped.
471-
472-
For "normal" VMAs, mlock_vma_pages_range() calls __mlock_vma_pages_range() to
473-
fault/allocate the pages and mlock them. Again, like mlock_fixup(),
474-
mlock_vma_pages_range() downgrades the mmap semaphore to read mode before
475-
attempting to fault/allocate and mlock the pages and "upgrades" the semaphore
476-
back to write mode before returning.
477-
478-
The callers of mlock_vma_pages_range() will have already added the memory range
466+
populate_vma_page_range() specifying the vma and the address range to mlock.
467+
468+
The callers of populate_vma_page_range() will have already added the memory range
479469
to be mlocked to the task's "locked_vm". To account for filtered VMAs,
480-
mlock_vma_pages_range() returns the number of pages NOT mlocked. All of the
470+
populate_vma_page_range() returns the number of pages NOT mlocked. All of the
481471
callers then subtract a non-negative return value from the task's locked_vm. A
482472
negative return value represent an error - for example, from get_user_pages()
483473
attempting to fault in a VMA with PROT_NONE access. In this case, we leave the

‎arch/Kconfig‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,9 @@ config HAVE_IRQ_TIME_ACCOUNTING
446446
config HAVE_ARCH_TRANSPARENT_HUGEPAGE
447447
bool
448448

449+
config HAVE_ARCH_HUGE_VMAP
450+
bool
451+
449452
config HAVE_ARCH_SOFT_DIRTY
450453
bool
451454

@@ -484,6 +487,18 @@ config HAVE_IRQ_EXIT_ON_IRQ_STACK
484487
This spares a stack switch and improves cache usage on softirq
485488
processing.
486489

490+
config PGTABLE_LEVELS
491+
int
492+
default 2
493+
494+
config ARCH_HAS_ELF_RANDOMIZE
495+
bool
496+
help
497+
An architecture supports choosing randomized locations for
498+
stack, mmap, brk, and ET_DYN. Defined functions:
499+
- arch_mmap_rnd()
500+
- arch_randomize_brk()
501+
487502
#
488503
# ABI hall of shame
489504
#

‎arch/alpha/Kconfig‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ config GENERIC_ISA_DMA
7676
bool
7777
default y
7878

79+
config PGTABLE_LEVELS
80+
int
81+
default 3
82+
7983
source "init/Kconfig"
8084
source "kernel/Kconfig.freezer"
8185

‎arch/arm/Kconfig‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
config ARM
22
bool
33
default y
4-
select ARCH_BINFMT_ELF_RANDOMIZE_PIE
54
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
5+
select ARCH_HAS_ELF_RANDOMIZE
66
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
77
select ARCH_HAVE_CUSTOM_GPIO_H
88
select ARCH_HAS_GCOV_PROFILE_ALL
@@ -286,6 +286,11 @@ config GENERIC_BUG
286286
def_bool y
287287
depends on BUG
288288

289+
config PGTABLE_LEVELS
290+
int
291+
default 3 if ARM_LPAE
292+
default 2
293+
289294
source "init/Kconfig"
290295

291296
source "kernel/Kconfig.freezer"

‎arch/arm/include/asm/elf.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,6 @@ int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs);
125125
extern void elf_set_personality(const struct elf32_hdr *);
126126
#define SET_PERSONALITY(ex) elf_set_personality(&(ex))
127127

128-
struct mm_struct;
129-
extern unsigned long arch_randomize_brk(struct mm_struct *mm);
130-
#define arch_randomize_brk arch_randomize_brk
131-
132128
#ifdef CONFIG_MMU
133129
#define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
134130
struct linux_binprm;

‎arch/arm/mm/init.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,9 @@ void __init bootmem_init(void)
335335

336336
find_limits(&min, &max_low, &max_high);
337337

338+
early_memtest((phys_addr_t)min << PAGE_SHIFT,
339+
(phys_addr_t)max_low << PAGE_SHIFT);
340+
338341
/*
339342
* Sparsemem tries to allocate bootmem in memory_present(),
340343
* so must be done after the fixed reservations

0 commit comments

Comments
 (0)