Skip to content

Commit 77b1a7f

Browse files
committed
Merge tag 'mm-nonmm-stable-2023-06-24-19-23' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull non-mm updates from Andrew Morton: - Arnd Bergmann has fixed a bunch of -Wmissing-prototypes in top-level directories - Douglas Anderson has added a new "buddy" mode to the hardlockup detector. It permits the detector to work on architectures which cannot provide the required interrupts, by having CPUs periodically perform checks on other CPUs - Zhen Lei has enhanced kexec's ability to support two crash regions - Petr Mladek has done a lot of cleanup on the hard lockup detector's Kconfig entries - And the usual bunch of singleton patches in various places * tag 'mm-nonmm-stable-2023-06-24-19-23' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (72 commits) kernel/time/posix-stubs.c: remove duplicated include ocfs2: remove redundant assignment to variable bit_off watchdog/hardlockup: fix typo in config HARDLOCKUP_DETECTOR_PREFER_BUDDY powerpc: move arch_trigger_cpumask_backtrace from nmi.h to irq.h devres: show which resource was invalid in __devm_ioremap_resource() watchdog/hardlockup: define HARDLOCKUP_DETECTOR_ARCH watchdog/sparc64: define HARDLOCKUP_DETECTOR_SPARC64 watchdog/hardlockup: make HAVE_NMI_WATCHDOG sparc64-specific watchdog/hardlockup: declare arch_touch_nmi_watchdog() only in linux/nmi.h watchdog/hardlockup: make the config checks more straightforward watchdog/hardlockup: sort hardlockup detector related config values a logical way watchdog/hardlockup: move SMP barriers from common code to buddy code watchdog/buddy: simplify the dependency for HARDLOCKUP_DETECTOR_PREFER_BUDDY watchdog/buddy: don't copy the cpumask in watchdog_next_cpu() watchdog/buddy: cleanup how watchdog_buddy_check_hardlockup() is called watchdog/hardlockup: remove softlockup comment in touch_nmi_watchdog() watchdog/hardlockup: in watchdog_hardlockup_check() use cpumask_copy() watchdog/hardlockup: don't use raw_cpu_ptr() in watchdog_hardlockup_kick() watchdog/hardlockup: HAVE_NMI_WATCHDOG must implement watchdog_hardlockup_probe() watchdog/hardlockup: keep kernel.nmi_watchdog sysctl as 0444 if probe fails ...
2 parents 6e17c6d + 4afc9a4 commit 77b1a7f

82 files changed

Lines changed: 957 additions & 422 deletions

Some content is hidden

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

arch/Kconfig

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -426,20 +426,14 @@ config HAVE_HARDLOCKUP_DETECTOR_PERF
426426
The arch chooses to use the generic perf-NMI-based hardlockup
427427
detector. Must define HAVE_PERF_EVENTS_NMI.
428428

429-
config HAVE_NMI_WATCHDOG
430-
depends on HAVE_NMI
431-
bool
432-
help
433-
The arch provides a low level NMI watchdog. It provides
434-
asm/nmi.h, and defines its own arch_touch_nmi_watchdog().
435-
436429
config HAVE_HARDLOCKUP_DETECTOR_ARCH
437430
bool
438-
select HAVE_NMI_WATCHDOG
439431
help
440-
The arch chooses to provide its own hardlockup detector, which is
441-
a superset of the HAVE_NMI_WATCHDOG. It also conforms to config
442-
interfaces and parameters provided by hardlockup detector subsystem.
432+
The arch provides its own hardlockup detector implementation instead
433+
of the generic ones.
434+
435+
It uses the same command line parameters, and sysctl interface,
436+
as the generic hardlockup detectors.
443437

444438
config HAVE_PERF_REGS
445439
bool

arch/arm/include/asm/irq.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ struct irqaction;
2727
struct pt_regs;
2828

2929
void handle_IRQ(unsigned int, struct pt_regs *);
30-
void init_IRQ(void);
3130

3231
#ifdef CONFIG_SMP
3332
#include <linux/cpumask.h>

arch/arm64/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,16 @@ config ARM64
204204
select HAVE_FUNCTION_ERROR_INJECTION
205205
select HAVE_FUNCTION_GRAPH_TRACER
206206
select HAVE_GCC_PLUGINS
207+
select HAVE_HARDLOCKUP_DETECTOR_PERF if PERF_EVENTS && \
208+
HW_PERF_EVENTS && HAVE_PERF_EVENTS_NMI
207209
select HAVE_HW_BREAKPOINT if PERF_EVENTS
208210
select HAVE_IOREMAP_PROT
209211
select HAVE_IRQ_TIME_ACCOUNTING
210212
select HAVE_KVM
211213
select HAVE_MOD_ARCH_SPECIFIC
212214
select HAVE_NMI
213215
select HAVE_PERF_EVENTS
216+
select HAVE_PERF_EVENTS_NMI if ARM64_PSEUDO_NMI
214217
select HAVE_PERF_REGS
215218
select HAVE_PERF_USER_STACK_DUMP
216219
select HAVE_PREEMPT_DYNAMIC_KEY

arch/arm64/include/asm/thread_info.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ struct thread_info {
5555
void arch_setup_new_exec(void);
5656
#define arch_setup_new_exec arch_setup_new_exec
5757

58-
void arch_release_task_struct(struct task_struct *tsk);
59-
int arch_dup_task_struct(struct task_struct *dst,
60-
struct task_struct *src);
61-
6258
#endif
6359

6460
#define TIF_SIGPENDING 0 /* signal pending */

arch/arm64/kernel/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ obj-$(CONFIG_KUSER_HELPERS) += kuser32.o
4444
obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o entry-ftrace.o
4545
obj-$(CONFIG_MODULES) += module.o module-plts.o
4646
obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o
47+
obj-$(CONFIG_HARDLOCKUP_DETECTOR_PERF) += watchdog_hld.o
4748
obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
4849
obj-$(CONFIG_CPU_PM) += sleep.o suspend.o
4950
obj-$(CONFIG_CPU_IDLE) += cpuidle.o

arch/arm64/kernel/watchdog_hld.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
#include <linux/nmi.h>
3+
#include <linux/cpufreq.h>
4+
#include <linux/perf/arm_pmu.h>
5+
6+
/*
7+
* Safe maximum CPU frequency in case a particular platform doesn't implement
8+
* cpufreq driver. Although, architecture doesn't put any restrictions on
9+
* maximum frequency but 5 GHz seems to be safe maximum given the available
10+
* Arm CPUs in the market which are clocked much less than 5 GHz. On the other
11+
* hand, we can't make it much higher as it would lead to a large hard-lockup
12+
* detection timeout on parts which are running slower (eg. 1GHz on
13+
* Developerbox) and doesn't possess a cpufreq driver.
14+
*/
15+
#define SAFE_MAX_CPU_FREQ 5000000000UL // 5 GHz
16+
u64 hw_nmi_get_sample_period(int watchdog_thresh)
17+
{
18+
unsigned int cpu = smp_processor_id();
19+
unsigned long max_cpu_freq;
20+
21+
max_cpu_freq = cpufreq_get_hw_max_freq(cpu) * 1000UL;
22+
if (!max_cpu_freq)
23+
max_cpu_freq = SAFE_MAX_CPU_FREQ;
24+
25+
return (u64)max_cpu_freq * watchdog_thresh;
26+
}
27+
28+
bool __init arch_perf_nmi_is_available(void)
29+
{
30+
/*
31+
* hardlockup_detector_perf_init() will success even if Pseudo-NMI turns off,
32+
* however, the pmu interrupts will act like a normal interrupt instead of
33+
* NMI and the hardlockup detector would be broken.
34+
*/
35+
return arm_pmu_irq_is_nmi();
36+
}

arch/microblaze/include/asm/setup.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ extern char *klimit;
1616

1717
extern void mmu_reset(void);
1818

19-
void time_init(void);
20-
void init_IRQ(void);
2119
void machine_early_init(const char *cmdline, unsigned int ram,
2220
unsigned int fdt, unsigned int msr, unsigned int tlb0,
2321
unsigned int tlb1);

arch/mips/include/asm/fw/cfe/cfe_api.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
#include <linux/types.h>
1818
#include <linux/string.h>
1919

20-
typedef long intptr_t;
21-
22-
2320
/*
2421
* Constants
2522
*/

arch/mips/include/asm/irq.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#define IRQ_STACK_SIZE THREAD_SIZE
2020
#define IRQ_STACK_START (IRQ_STACK_SIZE - 16)
2121

22-
extern void __init init_IRQ(void);
2322
extern void *irq_stack[NR_CPUS];
2423

2524
/*

arch/parisc/kernel/smp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ void arch_send_call_function_single_ipi(int cpu)
271271
static void
272272
smp_cpu_init(int cpunum)
273273
{
274-
extern void init_IRQ(void); /* arch/parisc/kernel/irq.c */
275274
extern void start_cpu_itimer(void); /* arch/parisc/kernel/time.c */
276275

277276
/* Set modes and Enable floating point coprocessor */

0 commit comments

Comments
 (0)