Skip to content

Commit 4d3e920

Browse files
committed
foo
1 parent ef107d2 commit 4d3e920

File tree

38 files changed

+2302
-6
lines changed

38 files changed

+2302
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
From: Rasmus Villemoes <[email protected]>
2+
Subject: lib/Kconfig.debug: remove more CONFIG_..._VALUE indirections
3+
4+
As in "kernel/panic.c: remove CONFIG_PANIC_ON_OOPS_VALUE indirection",
5+
use the IS_ENABLED() helper rather than having a hidden config option.
6+
7+
Link: https://lkml.kernel.org/r/[email protected]
8+
Signed-off-by: Rasmus Villemoes <[email protected]>
9+
Cc: Masahiro Yamada <[email protected]>
10+
Cc: Kees Cook <[email protected]>
11+
Signed-off-by: Andrew Morton <[email protected]>
12+
---
13+
14+
kernel/hung_task.c | 2 +-
15+
kernel/watchdog.c | 4 ++--
16+
lib/Kconfig.debug | 21 ---------------------
17+
3 files changed, 3 insertions(+), 24 deletions(-)
18+
19+
--- a/kernel/hung_task.c~lib-kconfigdebug-remove-more-config__value-indirections
20+
+++ a/kernel/hung_task.c
21+
@@ -73,7 +73,7 @@ static unsigned int __read_mostly sysctl
22+
* hung task is detected:
23+
*/
24+
unsigned int __read_mostly sysctl_hung_task_panic =
25+
- CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE;
26+
+ IS_ENABLED(CONFIG_BOOTPARAM_HUNG_TASK_PANIC);
27+
28+
static int
29+
hung_task_panic(struct notifier_block *this, unsigned long event, void *ptr)
30+
--- a/kernel/watchdog.c~lib-kconfigdebug-remove-more-config__value-indirections
31+
+++ a/kernel/watchdog.c
32+
@@ -57,7 +57,7 @@ int __read_mostly sysctl_hardlockup_all_
33+
* Should we panic when a soft-lockup or hard-lockup occurs:
34+
*/
35+
unsigned int __read_mostly hardlockup_panic =
36+
- CONFIG_BOOTPARAM_HARDLOCKUP_PANIC_VALUE;
37+
+ IS_ENABLED(CONFIG_BOOTPARAM_HARDLOCKUP_PANIC);
38+
/*
39+
* We may not want to enable hard lockup detection by default in all cases,
40+
* for example when running the kernel as a guest on a hypervisor. In these
41+
@@ -168,7 +168,7 @@ static struct cpumask watchdog_allowed_m
42+
43+
/* Global variables, exported for sysctl */
44+
unsigned int __read_mostly softlockup_panic =
45+
- CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE;
46+
+ IS_ENABLED(CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC);
47+
48+
static bool softlockup_initialized __read_mostly;
49+
static u64 __read_mostly sample_period;
50+
--- a/lib/Kconfig.debug~lib-kconfigdebug-remove-more-config__value-indirections
51+
+++ a/lib/Kconfig.debug
52+
@@ -1071,13 +1071,6 @@ config BOOTPARAM_SOFTLOCKUP_PANIC
53+
54+
Say N if unsure.
55+
56+
-config BOOTPARAM_SOFTLOCKUP_PANIC_VALUE
57+
- int
58+
- depends on SOFTLOCKUP_DETECTOR
59+
- range 0 1
60+
- default 0 if !BOOTPARAM_SOFTLOCKUP_PANIC
61+
- default 1 if BOOTPARAM_SOFTLOCKUP_PANIC
62+
-
63+
config HARDLOCKUP_DETECTOR_PERF
64+
bool
65+
select SOFTLOCKUP_DETECTOR
66+
@@ -1119,13 +1112,6 @@ config BOOTPARAM_HARDLOCKUP_PANIC
67+
68+
Say N if unsure.
69+
70+
-config BOOTPARAM_HARDLOCKUP_PANIC_VALUE
71+
- int
72+
- depends on HARDLOCKUP_DETECTOR
73+
- range 0 1
74+
- default 0 if !BOOTPARAM_HARDLOCKUP_PANIC
75+
- default 1 if BOOTPARAM_HARDLOCKUP_PANIC
76+
-
77+
config DETECT_HUNG_TASK
78+
bool "Detect Hung Tasks"
79+
depends on DEBUG_KERNEL
80+
@@ -1173,13 +1159,6 @@ config BOOTPARAM_HUNG_TASK_PANIC
81+
82+
Say N if unsure.
83+
84+
-config BOOTPARAM_HUNG_TASK_PANIC_VALUE
85+
- int
86+
- depends on DETECT_HUNG_TASK
87+
- range 0 1
88+
- default 0 if !BOOTPARAM_HUNG_TASK_PANIC
89+
- default 1 if BOOTPARAM_HUNG_TASK_PANIC
90+
-
91+
config WQ_WATCHDOG
92+
bool "Detect Workqueue Stalls"
93+
depends on DEBUG_KERNEL
94+
_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
From: Kuniyuki Iwashima <[email protected]>
2+
Subject: list: fix a data-race around ep->rdllist
3+
4+
ep_poll() first calls ep_events_available() with no lock held and checks
5+
if ep->rdllist is empty by list_empty_careful(), which reads
6+
rdllist->prev. Thus all accesses to it need some protection to avoid
7+
store/load-tearing.
8+
9+
Note INIT_LIST_HEAD_RCU() already has the annotation for both prev
10+
and next.
11+
12+
Commit bf3b9f6372c4 ("epoll: Add busy poll support to epoll with socket
13+
fds.") added the first lockless ep_events_available(), and commit
14+
c5a282e9635e ("fs/epoll: reduce the scope of wq lock in epoll_wait()")
15+
made some ep_events_available() calls lockless and added single call under
16+
a lock, finally commit e59d3c64cba6 ("epoll: eliminate unnecessary lock
17+
for zero timeout") made the last ep_events_available() lockless.
18+
19+
BUG: KCSAN: data-race in do_epoll_wait / do_epoll_wait
20+
21+
write to 0xffff88810480c7d8 of 8 bytes by task 1802 on cpu 0:
22+
INIT_LIST_HEAD include/linux/list.h:38 [inline]
23+
list_splice_init include/linux/list.h:492 [inline]
24+
ep_start_scan fs/eventpoll.c:622 [inline]
25+
ep_send_events fs/eventpoll.c:1656 [inline]
26+
ep_poll fs/eventpoll.c:1806 [inline]
27+
do_epoll_wait+0x4eb/0xf40 fs/eventpoll.c:2234
28+
do_epoll_pwait fs/eventpoll.c:2268 [inline]
29+
__do_sys_epoll_pwait fs/eventpoll.c:2281 [inline]
30+
__se_sys_epoll_pwait+0x12b/0x240 fs/eventpoll.c:2275
31+
__x64_sys_epoll_pwait+0x74/0x80 fs/eventpoll.c:2275
32+
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
33+
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
34+
entry_SYSCALL_64_after_hwframe+0x44/0xae
35+
36+
read to 0xffff88810480c7d8 of 8 bytes by task 1799 on cpu 1:
37+
list_empty_careful include/linux/list.h:329 [inline]
38+
ep_events_available fs/eventpoll.c:381 [inline]
39+
ep_poll fs/eventpoll.c:1797 [inline]
40+
do_epoll_wait+0x279/0xf40 fs/eventpoll.c:2234
41+
do_epoll_pwait fs/eventpoll.c:2268 [inline]
42+
__do_sys_epoll_pwait fs/eventpoll.c:2281 [inline]
43+
__se_sys_epoll_pwait+0x12b/0x240 fs/eventpoll.c:2275
44+
__x64_sys_epoll_pwait+0x74/0x80 fs/eventpoll.c:2275
45+
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
46+
do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80
47+
entry_SYSCALL_64_after_hwframe+0x44/0xae
48+
49+
value changed: 0xffff88810480c7d0 -> 0xffff888103c15098
50+
51+
Reported by Kernel Concurrency Sanitizer on:
52+
CPU: 1 PID: 1799 Comm: syz-fuzzer Tainted: G W 5.17.0-rc7-syzkaller-dirty #0
53+
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
54+
55+
Link: https://lkml.kernel.org/r/[email protected]
56+
Fixes: e59d3c64cba6 ("epoll: eliminate unnecessary lock for zero timeout")
57+
Fixes: c5a282e9635e ("fs/epoll: reduce the scope of wq lock in epoll_wait()")
58+
Fixes: bf3b9f6372c4 ("epoll: Add busy poll support to epoll with socket fds.")
59+
Signed-off-by: Kuniyuki Iwashima <[email protected]>
60+
Reported-by: [email protected]
61+
Cc: Al Viro <[email protected]>, Andrew Morton <[email protected]>
62+
Cc: Kuniyuki Iwashima <[email protected]>
63+
Cc: Kuniyuki Iwashima <[email protected]>
64+
Cc: "Soheil Hassas Yeganeh" <[email protected]>
65+
Cc: Davidlohr Bueso <[email protected]>
66+
Cc: "Sridhar Samudrala" <[email protected]>
67+
Cc: Alexander Duyck <[email protected]>
68+
Signed-off-by: Andrew Morton <[email protected]>
69+
---
70+
71+
include/linux/list.h | 6 +++---
72+
1 file changed, 3 insertions(+), 3 deletions(-)
73+
74+
--- a/include/linux/list.h~list-fix-a-data-race-around-ep-rdllist
75+
+++ a/include/linux/list.h
76+
@@ -35,7 +35,7 @@
77+
static inline void INIT_LIST_HEAD(struct list_head *list)
78+
{
79+
WRITE_ONCE(list->next, list);
80+
- list->prev = list;
81+
+ WRITE_ONCE(list->prev, list);
82+
}
83+
84+
#ifdef CONFIG_DEBUG_LIST
85+
@@ -306,7 +306,7 @@ static inline int list_empty(const struc
86+
static inline void list_del_init_careful(struct list_head *entry)
87+
{
88+
__list_del_entry(entry);
89+
- entry->prev = entry;
90+
+ WRITE_ONCE(entry->prev, entry);
91+
smp_store_release(&entry->next, entry);
92+
}
93+
94+
@@ -326,7 +326,7 @@ static inline void list_del_init_careful
95+
static inline int list_empty_careful(const struct list_head *head)
96+
{
97+
struct list_head *next = smp_load_acquire(&head->next);
98+
- return list_is_head(next, head) && (next == head->prev);
99+
+ return list_is_head(next, head) && (next == READ_ONCE(head->prev));
100+
}
101+
102+
/**
103+
_
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
From: Charan Teja Kalla <[email protected]>
2+
Subject: mm: compaction: fix compiler warning when CONFIG_COMPACTION=n
3+
4+
The below warning is reported when CONFIG_COMPACTION=n:
5+
6+
mm/compaction.c:56:27: warning: 'HPAGE_FRAG_CHECK_INTERVAL_MSEC'
7+
defined but not used [-Wunused-const-variable=]
8+
56 | static const unsigned int HPAGE_FRAG_CHECK_INTERVAL_MSEC =
9+
500;
10+
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11+
12+
Fix it by moving 'HPAGE_FRAG_CHECK_INTERVAL_MSEC' under
13+
CONFIG_COMPACTION defconfig. Also since this is just a 'static const
14+
int' type, use #define for it.
15+
16+
Link: https://lkml.kernel.org/r/[email protected]
17+
Signed-off-by: Charan Teja Kalla <[email protected]>
18+
Reported-by: kernel test robot <[email protected]>
19+
Acked-by: Vlastimil Babka <[email protected]>
20+
Cc: Nitin Gupta <[email protected]>
21+
Signed-off-by: Andrew Morton <[email protected]>
22+
---
23+
24+
mm/compaction.c | 10 +++++-----
25+
1 file changed, 5 insertions(+), 5 deletions(-)
26+
27+
--- a/mm/compaction.c~mm-compaction-fix-compiler-warning-when-config_compaction=n
28+
+++ a/mm/compaction.c
29+
@@ -26,6 +26,11 @@
30+
#include "internal.h"
31+
32+
#ifdef CONFIG_COMPACTION
33+
+/*
34+
+ * Fragmentation score check interval for proactive compaction purposes.
35+
+ */
36+
+#define HPAGE_FRAG_CHECK_INTERVAL_MSEC (500)
37+
+
38+
static inline void count_compact_event(enum vm_event_item item)
39+
{
40+
count_vm_event(item);
41+
@@ -51,11 +56,6 @@ static inline void count_compact_events(
42+
#define pageblock_end_pfn(pfn) block_end_pfn(pfn, pageblock_order)
43+
44+
/*
45+
- * Fragmentation score check interval for proactive compaction purposes.
46+
- */
47+
-static const unsigned int HPAGE_FRAG_CHECK_INTERVAL_MSEC = 500;
48+
-
49+
-/*
50+
* Page order with-respect-to which proactive compaction
51+
* calculates external fragmentation, which is used as
52+
* the "fragmentation score" of a node/zone.
53+
_

0 commit comments

Comments
 (0)