Skip to content

Commit 9ad57f6

Browse files
committed
Merge branch 'akpm' (patches from Andrew)
Merge more updates from Andrew Morton: - most of the rest of MM (memcg, hugetlb, vmscan, proc, compaction, mempolicy, oom-kill, hugetlbfs, migration, thp, cma, util, memory-hotplug, cleanups, uaccess, migration, gup, pagemap), - various other subsystems (alpha, misc, sparse, bitmap, lib, bitops, checkpatch, autofs, minix, nilfs, ufs, fat, signals, kmod, coredump, exec, kdump, rapidio, panic, kcov, kgdb, ipc). * emailed patches from Andrew Morton <[email protected]>: (164 commits) mm/gup: remove task_struct pointer for all gup code mm: clean up the last pieces of page fault accountings mm/xtensa: use general page fault accounting mm/x86: use general page fault accounting mm/sparc64: use general page fault accounting mm/sparc32: use general page fault accounting mm/sh: use general page fault accounting mm/s390: use general page fault accounting mm/riscv: use general page fault accounting mm/powerpc: use general page fault accounting mm/parisc: use general page fault accounting mm/openrisc: use general page fault accounting mm/nios2: use general page fault accounting mm/nds32: use general page fault accounting mm/mips: use general page fault accounting mm/microblaze: use general page fault accounting mm/m68k: use general page fault accounting mm/ia64: use general page fault accounting mm/hexagon: use general page fault accounting mm/csky: use general page fault accounting ...
2 parents 24fb33d + 64019a2 commit 9ad57f6

File tree

264 files changed

+2357
-1437
lines changed

Some content is hidden

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

264 files changed

+2357
-1437
lines changed

Documentation/admin-guide/cgroup-v2.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,10 @@ PAGE_SIZE multiple when read back.
12741274
Amount of memory used for storing in-kernel data
12751275
structures.
12761276

1277+
percpu
1278+
Amount of memory used for storing per-cpu kernel
1279+
data structures.
1280+
12771281
sock
12781282
Amount of memory used in network transmission buffers
12791283

Documentation/admin-guide/sysctl/kernel.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ core_pattern
164164
%s signal number
165165
%t UNIX time of dump
166166
%h hostname
167-
%e executable filename (may be shortened)
167+
%e executable filename (may be shortened, could be changed by prctl etc)
168+
%f executable filename
168169
%E executable path
169170
%c maximum size of core file by resource limit RLIMIT_CORE
170171
%<OTHER> both are dropped

Documentation/admin-guide/sysctl/vm.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,21 @@ all zones are compacted such that free memory is available in contiguous
119119
blocks where possible. This can be important for example in the allocation of
120120
huge pages although processes will also directly compact memory as required.
121121

122+
compaction_proactiveness
123+
========================
124+
125+
This tunable takes a value in the range [0, 100] with a default value of
126+
20. This tunable determines how aggressively compaction is done in the
127+
background. Setting it to 0 disables proactive compaction.
128+
129+
Note that compaction has a non-trivial system-wide impact as pages
130+
belonging to different processes are moved around, which could also lead
131+
to latency spikes in unsuspecting applications. The kernel employs
132+
various heuristics to avoid wasting CPU cycles if it detects that
133+
proactive compaction is not being effective.
134+
135+
Be careful when setting it to extreme values like 100, as that may
136+
cause excessive background compaction activity.
122137

123138
compact_unevictable_allowed
124139
===========================

Documentation/filesystems/proc.rst

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,9 +1633,6 @@ may allocate from based on an estimation of its current memory and swap use.
16331633
For example, if a task is using all allowed memory, its badness score will be
16341634
1000. If it is using half of its allowed memory, its score will be 500.
16351635

1636-
There is an additional factor included in the badness score: the current memory
1637-
and swap usage is discounted by 3% for root processes.
1638-
16391636
The amount of "allowed" memory depends on the context in which the oom killer
16401637
was called. If it is due to the memory assigned to the allocating task's cpuset
16411638
being exhausted, the allowed memory represents the set of mems assigned to that
@@ -1671,11 +1668,6 @@ The value of /proc/<pid>/oom_score_adj may be reduced no lower than the last
16711668
value set by a CAP_SYS_RESOURCE process. To reduce the value any lower
16721669
requires CAP_SYS_RESOURCE.
16731670

1674-
Caveat: when a parent task is selected, the oom killer will sacrifice any first
1675-
generation children with separate address spaces instead, if possible. This
1676-
avoids servers and important system daemons from being killed and loses the
1677-
minimal amount of work.
1678-
16791671

16801672
3.2 /proc/<pid>/oom_score - Display current oom-killer score
16811673
-------------------------------------------------------------
@@ -1684,6 +1676,9 @@ This file can be used to check the current score used by the oom-killer for
16841676
any given <pid>. Use it together with /proc/<pid>/oom_score_adj to tune which
16851677
process should be killed in an out-of-memory situation.
16861678

1679+
Please note that the exported value includes oom_score_adj so it is
1680+
effectively in range [0,2000].
1681+
16871682

16881683
3.3 /proc/<pid>/io - Display the IO accounting fields
16891684
-------------------------------------------------------

Documentation/vm/page_migration.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,5 +253,32 @@ which are function pointers of struct address_space_operations.
253253
PG_isolated is alias with PG_reclaim flag so driver shouldn't use the flag
254254
for own purpose.
255255

256+
Monitoring Migration
257+
=====================
258+
259+
The following events (counters) can be used to monitor page migration.
260+
261+
1. PGMIGRATE_SUCCESS: Normal page migration success. Each count means that a
262+
page was migrated. If the page was a non-THP page, then this counter is
263+
increased by one. If the page was a THP, then this counter is increased by
264+
the number of THP subpages. For example, migration of a single 2MB THP that
265+
has 4KB-size base pages (subpages) will cause this counter to increase by
266+
512.
267+
268+
2. PGMIGRATE_FAIL: Normal page migration failure. Same counting rules as for
269+
_SUCCESS, above: this will be increased by the number of subpages, if it was
270+
a THP.
271+
272+
3. THP_MIGRATION_SUCCESS: A THP was migrated without being split.
273+
274+
4. THP_MIGRATION_FAIL: A THP could not be migrated nor it could be split.
275+
276+
5. THP_MIGRATION_SPLIT: A THP was migrated, but not as such: first, the THP had
277+
to be split. After splitting, a migration retry was used for it's sub-pages.
278+
279+
THP_MIGRATION_* events also update the appropriate PGMIGRATE_SUCCESS or
280+
PGMIGRATE_FAIL events. For example, a THP migration failure will cause both
281+
THP_MIGRATION_FAIL and PGMIGRATE_FAIL to increase.
282+
256283
Christoph Lameter, May 8, 2006.
257284
Minchan Kim, Mar 28, 2016.

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,10 @@ KBUILD_CFLAGS += $(CC_FLAGS_SCS)
893893
export CC_FLAGS_SCS
894894
endif
895895

896+
ifdef CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_32B
897+
KBUILD_CFLAGS += -falign-functions=32
898+
endif
899+
896900
# arch Makefile may override CC so keep this after arch Makefile is included
897901
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
898902

arch/alpha/include/asm/io.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,10 +489,10 @@ extern inline void writeq(u64 b, volatile void __iomem *addr)
489489
}
490490
#endif
491491

492-
#define ioread16be(p) be16_to_cpu(ioread16(p))
493-
#define ioread32be(p) be32_to_cpu(ioread32(p))
494-
#define iowrite16be(v,p) iowrite16(cpu_to_be16(v), (p))
495-
#define iowrite32be(v,p) iowrite32(cpu_to_be32(v), (p))
492+
#define ioread16be(p) swab16(ioread16(p))
493+
#define ioread32be(p) swab32(ioread32(p))
494+
#define iowrite16be(v,p) iowrite16(swab16(v), (p))
495+
#define iowrite32be(v,p) iowrite32(swab32(v), (p))
496496

497497
#define inb_p inb
498498
#define inw_p inw

arch/alpha/include/asm/uaccess.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#define get_fs() (current_thread_info()->addr_limit)
2121
#define set_fs(x) (current_thread_info()->addr_limit = (x))
2222

23-
#define segment_eq(a, b) ((a).seg == (b).seg)
23+
#define uaccess_kernel() (get_fs().seg == KERNEL_DS.seg)
2424

2525
/*
2626
* Is a address valid? This does a straightforward calculation rather

arch/alpha/mm/fault.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/interrupt.h>
2626
#include <linux/extable.h>
2727
#include <linux/uaccess.h>
28+
#include <linux/perf_event.h>
2829

2930
extern void die_if_kernel(char *,struct pt_regs *,long, unsigned long *);
3031

@@ -116,6 +117,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
116117
#endif
117118
if (user_mode(regs))
118119
flags |= FAULT_FLAG_USER;
120+
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
119121
retry:
120122
mmap_read_lock(mm);
121123
vma = find_vma(mm, address);
@@ -148,7 +150,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
148150
/* If for any reason at all we couldn't handle the fault,
149151
make sure we exit gracefully rather than endlessly redo
150152
the fault. */
151-
fault = handle_mm_fault(vma, address, flags);
153+
fault = handle_mm_fault(vma, address, flags, regs);
152154

153155
if (fault_signal_pending(fault, regs))
154156
return;
@@ -164,10 +166,6 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
164166
}
165167

166168
if (flags & FAULT_FLAG_ALLOW_RETRY) {
167-
if (fault & VM_FAULT_MAJOR)
168-
current->maj_flt++;
169-
else
170-
current->min_flt++;
171169
if (fault & VM_FAULT_RETRY) {
172170
flags |= FAULT_FLAG_TRIED;
173171

arch/arc/include/asm/segment.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ typedef unsigned long mm_segment_t;
1414

1515
#define KERNEL_DS MAKE_MM_SEG(0)
1616
#define USER_DS MAKE_MM_SEG(TASK_SIZE)
17-
18-
#define segment_eq(a, b) ((a) == (b))
17+
#define uaccess_kernel() (get_fs() == KERNEL_DS)
1918

2019
#endif /* __ASSEMBLY__ */
2120
#endif /* __ASMARC_SEGMENT_H */

0 commit comments

Comments
 (0)