Skip to content

Commit e28c0d7

Browse files
committed
Merge branch 'akpm' (patches from Andrew)
Merge fixes from Andrew Morton: "14 patches. Subsystems affected by this patch series: mm (migration, vmscan, slub, gup, memcg, hugetlbfs), mailmap, kbuild, reboot, watchdog, panic, and ocfs2" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: ocfs2: initialize ip_next_orphan panic: don't dump stack twice on warn hugetlbfs: fix anon huge page migration race mm: memcontrol: fix missing wakeup polling thread kernel/watchdog: fix watchdog_allowed_mask not used warning reboot: fix overflow parsing reboot cpu number Revert "kernel/reboot.c: convert simple_strtoul to kstrtoint" compiler.h: fix barrier_data() on clang mm/gup: use unpin_user_pages() in __gup_longterm_locked() mm/slub: fix panic in slab_alloc_node() mailmap: fix entry for Dmitry Baryshkov/Eremin-Solenikov mm/vmscan: fix NR_ISOLATED_FILE corruption on 64-bit mm/compaction: stop isolation if too many pages are isolated and we have pages to migrate mm/compaction: count pages and stop correctly during page isolation
2 parents 31908a6 + f578528 commit e28c0d7

18 files changed

Lines changed: 118 additions & 186 deletions

File tree

.mailmap

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ Dengcheng Zhu <dzhu@wavecomp.com> <dengcheng.zhu@gmail.com>
8282
Dengcheng Zhu <dzhu@wavecomp.com> <dengcheng.zhu@imgtec.com>
8383
Dengcheng Zhu <dzhu@wavecomp.com> <dengcheng.zhu@mips.com>
8484
<dev.kurt@vandijck-laurijssen.be> <kurt.van.dijck@eia.be>
85-
Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
85+
Dmitry Baryshkov <dbaryshkov@gmail.com>
86+
Dmitry Baryshkov <dbaryshkov@gmail.com> <[dbaryshkov@gmail.com]>
87+
Dmitry Baryshkov <dbaryshkov@gmail.com> <dmitry_baryshkov@mentor.com>
88+
Dmitry Baryshkov <dbaryshkov@gmail.com> <dmitry_eremin@mentor.com>
8689
Dmitry Safonov <0x7f454c46@gmail.com> <dima@arista.com>
8790
Dmitry Safonov <0x7f454c46@gmail.com> <d.safonov@partner.samsung.com>
8891
Dmitry Safonov <0x7f454c46@gmail.com> <dsafonov@virtuozzo.com>

fs/ocfs2/super.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1713,6 +1713,7 @@ static void ocfs2_inode_init_once(void *data)
17131713

17141714
oi->ip_blkno = 0ULL;
17151715
oi->ip_clusters = 0;
1716+
oi->ip_next_orphan = NULL;
17161717

17171718
ocfs2_resv_init_once(&oi->ip_la_data_resv);
17181719

include/asm-generic/barrier.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#ifndef __ASSEMBLY__
1515

16+
#include <linux/compiler.h>
1617
#include <asm/rwonce.h>
1718

1819
#ifndef nop

include/linux/compiler-clang.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,6 @@
6060
#define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1
6161
#endif
6262

63-
/* The following are for compatibility with GCC, from compiler-gcc.h,
64-
* and may be redefined here because they should not be shared with other
65-
* compilers, like ICC.
66-
*/
67-
#define barrier() __asm__ __volatile__("" : : : "memory")
68-
6963
#if __has_feature(shadow_call_stack)
7064
# define __noscs __attribute__((__no_sanitize__("shadow-call-stack")))
7165
#endif

include/linux/compiler-gcc.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,6 @@
1515
# error Sorry, your version of GCC is too old - please use 4.9 or newer.
1616
#endif
1717

18-
/* Optimization barrier */
19-
20-
/* The "volatile" is due to gcc bugs */
21-
#define barrier() __asm__ __volatile__("": : :"memory")
22-
/*
23-
* This version is i.e. to prevent dead stores elimination on @ptr
24-
* where gcc and llvm may behave differently when otherwise using
25-
* normal barrier(): while gcc behavior gets along with a normal
26-
* barrier(), llvm needs an explicit input variable to be assumed
27-
* clobbered. The issue is as follows: while the inline asm might
28-
* access any memory it wants, the compiler could have fit all of
29-
* @ptr into memory registers instead, and since @ptr never escaped
30-
* from that, it proved that the inline asm wasn't touching any of
31-
* it. This version works well with both compilers, i.e. we're telling
32-
* the compiler that the inline asm absolutely may see the contents
33-
* of @ptr. See also: https://llvm.org/bugs/show_bug.cgi?id=15495
34-
*/
35-
#define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory")
36-
3718
/*
3819
* This macro obfuscates arithmetic on a variable address so that gcc
3920
* shouldn't recognize the original var, and make assumptions about it.

include/linux/compiler.h

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,25 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
8080

8181
/* Optimization barrier */
8282
#ifndef barrier
83-
# define barrier() __memory_barrier()
83+
/* The "volatile" is due to gcc bugs */
84+
# define barrier() __asm__ __volatile__("": : :"memory")
8485
#endif
8586

8687
#ifndef barrier_data
87-
# define barrier_data(ptr) barrier()
88+
/*
89+
* This version is i.e. to prevent dead stores elimination on @ptr
90+
* where gcc and llvm may behave differently when otherwise using
91+
* normal barrier(): while gcc behavior gets along with a normal
92+
* barrier(), llvm needs an explicit input variable to be assumed
93+
* clobbered. The issue is as follows: while the inline asm might
94+
* access any memory it wants, the compiler could have fit all of
95+
* @ptr into memory registers instead, and since @ptr never escaped
96+
* from that, it proved that the inline asm wasn't touching any of
97+
* it. This version works well with both compilers, i.e. we're telling
98+
* the compiler that the inline asm absolutely may see the contents
99+
* of @ptr. See also: https://llvm.org/bugs/show_bug.cgi?id=15495
100+
*/
101+
# define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory")
88102
#endif
89103

90104
/* workaround for GCC PR82365 if needed */

include/linux/memcontrol.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,12 +900,19 @@ static inline void count_memcg_event_mm(struct mm_struct *mm,
900900
static inline void memcg_memory_event(struct mem_cgroup *memcg,
901901
enum memcg_memory_event event)
902902
{
903+
bool swap_event = event == MEMCG_SWAP_HIGH || event == MEMCG_SWAP_MAX ||
904+
event == MEMCG_SWAP_FAIL;
905+
903906
atomic_long_inc(&memcg->memory_events_local[event]);
904-
cgroup_file_notify(&memcg->events_local_file);
907+
if (!swap_event)
908+
cgroup_file_notify(&memcg->events_local_file);
905909

906910
do {
907911
atomic_long_inc(&memcg->memory_events[event]);
908-
cgroup_file_notify(&memcg->events_file);
912+
if (swap_event)
913+
cgroup_file_notify(&memcg->swap_events_file);
914+
else
915+
cgroup_file_notify(&memcg->events_file);
909916

910917
if (!cgroup_subsys_on_dfl(memory_cgrp_subsys))
911918
break;

kernel/panic.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,8 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
605605
panic("panic_on_warn set ...\n");
606606
}
607607

608-
dump_stack();
608+
if (!regs)
609+
dump_stack();
609610

610611
print_irqtrace_events(current);
611612

kernel/reboot.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -551,22 +551,22 @@ static int __init reboot_setup(char *str)
551551
break;
552552

553553
case 's':
554-
{
555-
int rc;
556-
557-
if (isdigit(*(str+1))) {
558-
rc = kstrtoint(str+1, 0, &reboot_cpu);
559-
if (rc)
560-
return rc;
561-
} else if (str[1] == 'm' && str[2] == 'p' &&
562-
isdigit(*(str+3))) {
563-
rc = kstrtoint(str+3, 0, &reboot_cpu);
564-
if (rc)
565-
return rc;
566-
} else
554+
if (isdigit(*(str+1)))
555+
reboot_cpu = simple_strtoul(str+1, NULL, 0);
556+
else if (str[1] == 'm' && str[2] == 'p' &&
557+
isdigit(*(str+3)))
558+
reboot_cpu = simple_strtoul(str+3, NULL, 0);
559+
else
567560
*mode = REBOOT_SOFT;
561+
if (reboot_cpu >= num_possible_cpus()) {
562+
pr_err("Ignoring the CPU number in reboot= option. "
563+
"CPU %d exceeds possible cpu number %d\n",
564+
reboot_cpu, num_possible_cpus());
565+
reboot_cpu = 0;
566+
break;
567+
}
568568
break;
569-
}
569+
570570
case 'g':
571571
*mode = REBOOT_GPIO;
572572
break;

kernel/watchdog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ int __read_mostly soft_watchdog_user_enabled = 1;
4444
int __read_mostly watchdog_thresh = 10;
4545
static int __read_mostly nmi_watchdog_available;
4646

47-
static struct cpumask watchdog_allowed_mask __read_mostly;
48-
4947
struct cpumask watchdog_cpumask __read_mostly;
5048
unsigned long *watchdog_cpumask_bits = cpumask_bits(&watchdog_cpumask);
5149

@@ -162,6 +160,8 @@ static void lockup_detector_update_enable(void)
162160
int __read_mostly sysctl_softlockup_all_cpu_backtrace;
163161
#endif
164162

163+
static struct cpumask watchdog_allowed_mask __read_mostly;
164+
165165
/* Global variables, exported for sysctl */
166166
unsigned int __read_mostly softlockup_panic =
167167
CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE;

0 commit comments

Comments
 (0)