Skip to content

Commit 814a2bf

Browse files
committed
Merge branch 'akpm' (patches from Andrew)
Merge second patch-bomb from Andrew Morton: - a couple of hotfixes - the rest of MM - a new timer slack control in procfs - a couple of procfs fixes - a few misc things - some printk tweaks - lib/ updates, notably to radix-tree. - add my and Nick Piggin's old userspace radix-tree test harness to tools/testing/radix-tree/. Matthew said it was a godsend during the radix-tree work he did. - a few code-size improvements, switching to __always_inline where gcc screwed up. - partially implement character sets in sscanf * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (118 commits) sscanf: implement basic character sets lib/bug.c: use common WARN helper param: convert some "on"/"off" users to strtobool lib: add "on"/"off" support to kstrtobool lib: update single-char callers of strtobool() lib: move strtobool() to kstrtobool() include/linux/unaligned: force inlining of byteswap operations include/uapi/linux/byteorder, swab: force inlining of some byteswap operations include/asm-generic/atomic-long.h: force inlining of some atomic_long operations usb: common: convert to use match_string() helper ide: hpt366: convert to use match_string() helper ata: hpt366: convert to use match_string() helper power: ab8500: convert to use match_string() helper power: charger_manager: convert to use match_string() helper drm/edid: convert to use match_string() helper pinctrl: convert to use match_string() helper device property: convert to use match_string() helper lib/string: introduce match_string() helper radix-tree tests: add test for radix_tree_iter_next radix-tree tests: add regression3 test ...
2 parents 237045f + f9310b2 commit 814a2bf

File tree

225 files changed

+5048
-1915
lines changed

Some content is hidden

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

225 files changed

+5048
-1915
lines changed

Documentation/cgroup-v1/cgroups.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Original copyright statements from cpusets.txt:
88
Portions Copyright (C) 2004 BULL SA.
99
Portions Copyright (c) 2004-2006 Silicon Graphics, Inc.
1010
Modified by Paul Jackson <pj@sgi.com>
11-
Modified by Christoph Lameter <clameter@sgi.com>
11+
Modified by Christoph Lameter <cl@linux.com>
1212

1313
CONTENTS:
1414
=========

Documentation/cgroup-v1/cpusets.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Written by Simon.Derr@bull.net
66

77
Portions Copyright (c) 2004-2006 Silicon Graphics, Inc.
88
Modified by Paul Jackson <pj@sgi.com>
9-
Modified by Christoph Lameter <clameter@sgi.com>
9+
Modified by Christoph Lameter <cl@linux.com>
1010
Modified by Paul Menage <menage@google.com>
1111
Modified by Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
1212

Documentation/cgroup-v2.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,15 @@ PAGE_SIZE multiple when read back.
843843
Amount of memory used to cache filesystem data,
844844
including tmpfs and shared memory.
845845

846+
kernel_stack
847+
848+
Amount of memory allocated to kernel stacks.
849+
850+
slab
851+
852+
Amount of memory used for storing in-kernel data
853+
structures.
854+
846855
sock
847856

848857
Amount of memory used in network transmission buffers
@@ -871,6 +880,16 @@ PAGE_SIZE multiple when read back.
871880
on the internal memory management lists used by the
872881
page reclaim algorithm
873882

883+
slab_reclaimable
884+
885+
Part of "slab" that might be reclaimed, such as
886+
dentries and inodes.
887+
888+
slab_unreclaimable
889+
890+
Part of "slab" that cannot be reclaimed on memory
891+
pressure.
892+
874893
pgfault
875894

876895
Total number of page faults incurred
@@ -1368,6 +1387,12 @@ system than killing the group. Otherwise, memory.max is there to
13681387
limit this type of spillover and ultimately contain buggy or even
13691388
malicious applications.
13701389

1390+
Setting the original memory.limit_in_bytes below the current usage was
1391+
subject to a race condition, where concurrent charges could cause the
1392+
limit setting to fail. memory.max on the other hand will first set the
1393+
limit to prevent new charges, and then reclaim and OOM kill until the
1394+
new limit is met - or the task writing to memory.max is killed.
1395+
13711396
The combined memory+swap accounting and limiting is replaced by real
13721397
control over swap space.
13731398

Documentation/filesystems/proc.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Table of Contents
4343
3.7 /proc/<pid>/task/<tid>/children - Information about task children
4444
3.8 /proc/<pid>/fdinfo/<fd> - Information about opened file
4545
3.9 /proc/<pid>/map_files - Information about memory mapped files
46+
3.10 /proc/<pid>/timerslack_ns - Task timerslack value
4647

4748
4 Configuring procfs
4849
4.1 Mount options
@@ -1862,6 +1863,23 @@ time one can open(2) mappings from the listings of two processes and
18621863
comparing their inode numbers to figure out which anonymous memory areas
18631864
are actually shared.
18641865

1866+
3.10 /proc/<pid>/timerslack_ns - Task timerslack value
1867+
---------------------------------------------------------
1868+
This file provides the value of the task's timerslack value in nanoseconds.
1869+
This value specifies a amount of time that normal timers may be deferred
1870+
in order to coalesce timers and avoid unnecessary wakeups.
1871+
1872+
This allows a task's interactivity vs power consumption trade off to be
1873+
adjusted.
1874+
1875+
Writing 0 to the file will set the tasks timerslack to the default value.
1876+
1877+
Valid values are from 0 - ULLONG_MAX
1878+
1879+
An application setting the value must have PTRACE_MODE_ATTACH_FSCREDS level
1880+
permissions on the task specified to change its timerslack_ns value.
1881+
1882+
18651883
------------------------------------------------------------------------------
18661884
Configuring procfs
18671885
------------------------------------------------------------------------------

Documentation/sysctl/vm.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,24 @@ performance impact. Reclaim code needs to take various locks to find freeable
803803
directory and inode objects. With vfs_cache_pressure=1000, it will look for
804804
ten times more freeable objects than there are.
805805

806+
=============================================================
807+
808+
watermark_scale_factor:
809+
810+
This factor controls the aggressiveness of kswapd. It defines the
811+
amount of memory left in a node/system before kswapd is woken up and
812+
how much memory needs to be free before kswapd goes back to sleep.
813+
814+
The unit is in fractions of 10,000. The default value of 10 means the
815+
distances between watermarks are 0.1% of the available memory in the
816+
node/system. The maximum value is 1000, or 10% of memory.
817+
818+
A high rate of threads entering direct reclaim (allocstall) or kswapd
819+
going to sleep prematurely (kswapd_low_wmark_hit_quickly) can indicate
820+
that the number of free pages kswapd maintains for latency reasons is
821+
too small for the allocation bursts occurring in the system. This knob
822+
can then be used to tune kswapd aggressiveness accordingly.
823+
806824
==============================================================
807825

808826
zone_reclaim_mode:

Documentation/vm/transhuge.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,26 @@ guaranteed, but it may be more likely in case the allocation is for a
113113
MADV_HUGEPAGE region.
114114

115115
echo always >/sys/kernel/mm/transparent_hugepage/defrag
116+
echo defer >/sys/kernel/mm/transparent_hugepage/defrag
116117
echo madvise >/sys/kernel/mm/transparent_hugepage/defrag
117118
echo never >/sys/kernel/mm/transparent_hugepage/defrag
118119

120+
"always" means that an application requesting THP will stall on allocation
121+
failure and directly reclaim pages and compact memory in an effort to
122+
allocate a THP immediately. This may be desirable for virtual machines
123+
that benefit heavily from THP use and are willing to delay the VM start
124+
to utilise them.
125+
126+
"defer" means that an application will wake kswapd in the background
127+
to reclaim pages and wake kcompact to compact memory so that THP is
128+
available in the near future. It's the responsibility of khugepaged
129+
to then install the THP pages later.
130+
131+
"madvise" will enter direct reclaim like "always" but only for regions
132+
that are have used madvise(MADV_HUGEPAGE). This is the default behaviour.
133+
134+
"never" should be self-explanatory.
135+
119136
By default kernel tries to use huge zero page on read page fault.
120137
It's possible to disable huge zero page by writing 0 or enable it
121138
back by writing 1:
@@ -229,6 +246,11 @@ thp_split_page is incremented every time a huge page is split into base
229246
thp_split_page_failed is is incremented if kernel fails to split huge
230247
page. This can happen if the page was pinned by somebody.
231248

249+
thp_deferred_split_page is incremented when a huge page is put onto split
250+
queue. This happens when a huge page is partially unmapped and
251+
splitting it would free up some memory. Pages on split queue are
252+
going to be split under memory pressure.
253+
232254
thp_split_pmd is incremented every time a PMD split into table of PTEs.
233255
This can happen, for instance, when application calls mprotect() or
234256
munmap() on part of huge page. It doesn't split huge page, only

MAINTAINERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8498,7 +8498,7 @@ F: include/crypto/pcrypt.h
84988498

84998499
PER-CPU MEMORY ALLOCATOR
85008500
M: Tejun Heo <tj@kernel.org>
8501-
M: Christoph Lameter <cl@linux-foundation.org>
8501+
M: Christoph Lameter <cl@linux.com>
85028502
T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu.git
85038503
S: Maintained
85048504
F: include/linux/percpu*.h
@@ -11296,7 +11296,6 @@ F: include/linux/cdrom.h
1129611296
F: include/uapi/linux/cdrom.h
1129711297

1129811298
UNISYS S-PAR DRIVERS
11299-
M: Benjamin Romer <benjamin.romer@unisys.com>
1130011299
M: David Kershner <david.kershner@unisys.com>
1130111300
L: sparmaintainer@unisys.com (Unisys internal)
1130211301
S: Supported

arch/arc/include/asm/hugepage.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,16 @@ static inline pmd_t pte_pmd(pte_t pte)
3030
#define pmd_mkyoung(pmd) pte_pmd(pte_mkyoung(pmd_pte(pmd)))
3131
#define pmd_mkhuge(pmd) pte_pmd(pte_mkhuge(pmd_pte(pmd)))
3232
#define pmd_mknotpresent(pmd) pte_pmd(pte_mknotpresent(pmd_pte(pmd)))
33-
#define pmd_mksplitting(pmd) pte_pmd(pte_mkspecial(pmd_pte(pmd)))
3433
#define pmd_mkclean(pmd) pte_pmd(pte_mkclean(pmd_pte(pmd)))
3534

3635
#define pmd_write(pmd) pte_write(pmd_pte(pmd))
3736
#define pmd_young(pmd) pte_young(pmd_pte(pmd))
3837
#define pmd_pfn(pmd) pte_pfn(pmd_pte(pmd))
3938
#define pmd_dirty(pmd) pte_dirty(pmd_pte(pmd))
40-
#define pmd_special(pmd) pte_special(pmd_pte(pmd))
4139

4240
#define mk_pmd(page, prot) pte_pmd(mk_pte(page, prot))
4341

4442
#define pmd_trans_huge(pmd) (pmd_val(pmd) & _PAGE_HW_SZ)
45-
#define pmd_trans_splitting(pmd) (pmd_trans_huge(pmd) && pmd_special(pmd))
4643

4744
#define pfn_pmd(pfn, prot) (__pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)))
4845

arch/arm/mm/fault.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
346346
up_read(&mm->mmap_sem);
347347

348348
/*
349-
* Handle the "normal" case first - VM_FAULT_MAJOR / VM_FAULT_MINOR
349+
* Handle the "normal" case first - VM_FAULT_MAJOR
350350
*/
351351
if (likely(!(fault & (VM_FAULT_ERROR | VM_FAULT_BADMAP | VM_FAULT_BADACCESS))))
352352
return 0;

arch/arm/mm/mmu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ static void *__init late_alloc(unsigned long sz)
732732
return ptr;
733733
}
734734

735-
static pte_t * __init pte_alloc(pmd_t *pmd, unsigned long addr,
735+
static pte_t * __init arm_pte_alloc(pmd_t *pmd, unsigned long addr,
736736
unsigned long prot,
737737
void *(*alloc)(unsigned long sz))
738738
{
@@ -747,7 +747,7 @@ static pte_t * __init pte_alloc(pmd_t *pmd, unsigned long addr,
747747
static pte_t * __init early_pte_alloc(pmd_t *pmd, unsigned long addr,
748748
unsigned long prot)
749749
{
750-
return pte_alloc(pmd, addr, prot, early_alloc);
750+
return arm_pte_alloc(pmd, addr, prot, early_alloc);
751751
}
752752

753753
static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr,
@@ -756,7 +756,7 @@ static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr,
756756
void *(*alloc)(unsigned long sz),
757757
bool ng)
758758
{
759-
pte_t *pte = pte_alloc(pmd, addr, type->prot_l1, alloc);
759+
pte_t *pte = arm_pte_alloc(pmd, addr, type->prot_l1, alloc);
760760
do {
761761
set_pte_ext(pte, pfn_pte(pfn, __pgprot(type->prot_pte)),
762762
ng ? PTE_EXT_NG : 0);

arch/arm/mm/pgd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pgd_t *pgd_alloc(struct mm_struct *mm)
8080
if (!new_pmd)
8181
goto no_pmd;
8282

83-
new_pte = pte_alloc_map(mm, NULL, new_pmd, 0);
83+
new_pte = pte_alloc_map(mm, new_pmd, 0);
8484
if (!new_pte)
8585
goto no_pte;
8686

arch/arm64/mm/fault.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
304304
up_read(&mm->mmap_sem);
305305

306306
/*
307-
* Handle the "normal" case first - VM_FAULT_MAJOR / VM_FAULT_MINOR
307+
* Handle the "normal" case first - VM_FAULT_MAJOR
308308
*/
309309
if (likely(!(fault & (VM_FAULT_ERROR | VM_FAULT_BADMAP |
310310
VM_FAULT_BADACCESS))))

arch/arm64/mm/hugetlbpage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm,
124124
* will be no pte_unmap() to correspond with this
125125
* pte_alloc_map().
126126
*/
127-
pte = pte_alloc_map(mm, NULL, pmd, addr);
127+
pte = pte_alloc_map(mm, pmd, addr);
128128
} else if (sz == PMD_SIZE) {
129129
if (IS_ENABLED(CONFIG_ARCH_WANT_HUGE_PMD_SHARE) &&
130130
pud_none(*pud))

arch/c6x/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ config GENERIC_HWEIGHT
3636

3737
config GENERIC_BUG
3838
def_bool y
39+
depends on BUG
3940

4041
config C6X_BIG_KERNEL
4142
bool "Build a big kernel"

arch/ia64/include/asm/io.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ static inline void __iomem * ioremap_cache (unsigned long phys_addr, unsigned lo
433433
return ioremap(phys_addr, size);
434434
}
435435
#define ioremap_cache ioremap_cache
436+
#define ioremap_uc ioremap_nocache
436437

437438

438439
/*

arch/ia64/include/asm/rwsem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (C) 2003 Ken Chen <kenneth.w.chen@intel.com>
55
* Copyright (C) 2003 Asit Mallick <asit.k.mallick@intel.com>
6-
* Copyright (C) 2005 Christoph Lameter <clameter@sgi.com>
6+
* Copyright (C) 2005 Christoph Lameter <cl@linux.com>
77
*
88
* Based on asm-i386/rwsem.h and other architecture implementation.
99
*

arch/ia64/mm/hugetlbpage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ huge_pte_alloc(struct mm_struct *mm, unsigned long addr, unsigned long sz)
3838
if (pud) {
3939
pmd = pmd_alloc(mm, pud, taddr);
4040
if (pmd)
41-
pte = pte_alloc_map(mm, NULL, pmd, taddr);
41+
pte = pte_alloc_map(mm, pmd, taddr);
4242
}
4343
return pte;
4444
}

arch/metag/mm/hugetlbpage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm,
6767
pgd = pgd_offset(mm, addr);
6868
pud = pud_offset(pgd, addr);
6969
pmd = pmd_offset(pud, addr);
70-
pte = pte_alloc_map(mm, NULL, pmd, addr);
70+
pte = pte_alloc_map(mm, pmd, addr);
7171
pgd->pgd &= ~_PAGE_SZ_MASK;
7272
pgd->pgd |= _PAGE_SZHUGE;
7373

arch/mips/mm/gup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static inline void get_head_page_multiple(struct page *page, int nr)
6464
{
6565
VM_BUG_ON(page != compound_head(page));
6666
VM_BUG_ON(page_count(page) == 0);
67-
atomic_add(nr, &page->_count);
67+
page_ref_add(page, nr);
6868
SetPageReferenced(page);
6969
}
7070

arch/mn10300/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ config GENERIC_HWEIGHT
5353

5454
config GENERIC_BUG
5555
def_bool y
56+
depends on BUG
5657

5758
config QUICKLIST
5859
def_bool y

arch/mn10300/kernel/fpu-nofpu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* 2 of the Licence, or (at your option) any later version.
1010
*/
1111
#include <asm/fpu.h>
12+
#include <asm/elf.h>
1213

1314
/*
1415
* handle an FPU operational exception

arch/parisc/mm/hugetlbpage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm,
6363
if (pud) {
6464
pmd = pmd_alloc(mm, pud, addr);
6565
if (pmd)
66-
pte = pte_alloc_map(mm, NULL, pmd, addr);
66+
pte = pte_alloc_map(mm, pmd, addr);
6767
}
6868
return pte;
6969
}

arch/powerpc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ config PPC
158158
select ARCH_HAS_DEVMEM_IS_ALLOWED
159159
select HAVE_ARCH_SECCOMP_FILTER
160160
select ARCH_HAS_UBSAN_SANITIZE_ALL
161+
select ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT
161162

162163
config GENERIC_CSUM
163164
def_bool CPU_LITTLE_ENDIAN

arch/powerpc/kernel/rtasd.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static unsigned int rtas_error_log_buffer_max;
4949
static unsigned int event_scan;
5050
static unsigned int rtas_event_scan_rate;
5151

52-
static int full_rtas_msgs = 0;
52+
static bool full_rtas_msgs;
5353

5454
/* Stop logging to nvram after first fatal error */
5555
static int logging_enabled; /* Until we initialize everything,
@@ -592,11 +592,6 @@ __setup("surveillance=", surveillance_setup);
592592

593593
static int __init rtasmsgs_setup(char *str)
594594
{
595-
if (strcmp(str, "on") == 0)
596-
full_rtas_msgs = 1;
597-
else if (strcmp(str, "off") == 0)
598-
full_rtas_msgs = 0;
599-
600-
return 1;
595+
return (kstrtobool(str, &full_rtas_msgs) == 0);
601596
}
602597
__setup("rtasmsgs=", rtasmsgs_setup);

arch/powerpc/kernel/traps.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,8 @@ static int __kprobes __die(const char *str, struct pt_regs *regs, long err)
203203
#ifdef CONFIG_SMP
204204
printk("SMP NR_CPUS=%d ", NR_CPUS);
205205
#endif
206-
#ifdef CONFIG_DEBUG_PAGEALLOC
207-
printk("DEBUG_PAGEALLOC ");
208-
#endif
206+
if (debug_pagealloc_enabled())
207+
printk("DEBUG_PAGEALLOC ");
209208
#ifdef CONFIG_NUMA
210209
printk("NUMA ");
211210
#endif

0 commit comments

Comments
 (0)