Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interrupt counters on struct intr_event #1301

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a23afcf
kern/sbuf: remove skipping of NUL characters from sbuf_putc_func()
ehem Mar 11, 2023
6cde047
kern/intr: replace mutex with read-write lock
ehem Sep 28, 2022
69ec656
sys: move hw.intrnames/hw.intrcnt SYSCTL_PROC()s to architecture
ehem Dec 22, 2022
1ec5fff
kern/intr: add intr_event flag for multi-proc interrupts
ehem Feb 11, 2023
cbaacad
kern/intr: add interrupt counters to intr_isrc
ehem Sep 14, 2022
00ac45b
kern/intr: add handling of multiprocessor interrupt counters
ehem May 12, 2024
42d6610
kern/intr: add verbose boot message for multi-processor counters
ehem Jun 26, 2024
7fb11c6
kern/intr: switch intr_event_handle() to return stray count
ehem Sep 30, 2022
3e994fc
kern/intr: implement intrcnt/intrnames sysctl from event counters
ehem Feb 17, 2023
661fc8d
intrng: move handling of hw.intrnames/hw.intrcnt to architecture
ehem Dec 22, 2022
cd8c18d
intrng: switch to index var from table size vars
ehem Jan 18, 2023
1b93c90
intrng: remove normal interrupts from intrcnt/intrnames
ehem Sep 15, 2022
5569b9c
intrng: implement intrcnt/intrnames sysctl from event counters
ehem Feb 17, 2023
510296e
intrng: remove intrcnts from non-SMP builds
ehem Dec 23, 2022
5446b58
intr/x86: move handling of hw.intrnames/hw.intrcnt to architecture
ehem Dec 22, 2022
28aa109
intr/x86: switch to index vars from table size vars
ehem Jan 18, 2023
e7efdb7
intr/x86: implement intrcnt/intrnames sysctl from event counters
ehem Feb 17, 2023
e3b81b9
intr/x86: remove normal interrupts from intrcnt/intrnames
ehem Dec 22, 2022
0d27de0
intr/powerpc: move handling of hw.intrnames/hw.intrcnt to architecture
ehem Dec 22, 2022
15a82fc
intr/powerpc: switch to index var from table size vars
ehem Jan 18, 2023
b8c18b0
intr/powerpc: implement intrcnt/intrnames sysctl from event counters
ehem Feb 17, 2023
75d3566
intr/powerpc: remove normal interrupts from intrcnt/intrnames
ehem Sep 23, 2022
6e3e4cd
sys: remove old handling of hw.intrnames/hw.intrcnt from common
ehem Dec 22, 2022
1a61d99
intrng: remove intrcnts from non-SMP builds
ehem Dec 23, 2022
0e344dd
kern/intr: enable stray counting for non-acknowledged interrupts
ehem Sep 30, 2022
f2d2d24
kern/intr: add handling for handled stray filter return
ehem Sep 25, 2023
fcd5411
kern/intr: add bus flag for multi-proc interrupts
ehem Aug 7, 2023
530bff6
kern/intr: enforce PPI interrupt for PPI requests
ehem Aug 7, 2023
b6ed957
sys/intr: remove questionable interrupt report
ehem Dec 22, 2022
7be062e
kern: move clk_intr_event to clock.[ch]
ehem Aug 8, 2023
7e6d8ea
kern: remove clk_intr_event from non-ACPI
ehem Jun 27, 2023
e98b020
kern/intr: use swi_add() string as name if no handler
ehem Jun 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion sys/dev/acpica/acpi_apei.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/callout.h>
#include <sys/clock.h>
#include <sys/interrupt.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
Expand Down Expand Up @@ -730,7 +731,8 @@ apei_attach(device_t dev)
TAILQ_INSERT_TAIL(&sc->nges.ges, ge, nlink);
if (sc->nges.swi_ih == NULL) {
swi_add(&clk_intr_event, "apei", apei_nmi_swi,
&sc->nges, SWI_CLOCK, INTR_MPSAFE,
&sc->nges, SWI_CLOCK,
INTR_MPSAFE | INTR_MULTIPROC,
&sc->nges.swi_ih);
apei_nmi_nges = &sc->nges;
apei_nmi = apei_nmi_handler;
Expand Down
29 changes: 28 additions & 1 deletion sys/kern/kern_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "opt_hwpmc_hooks.h"
#include "opt_ntp.h"
#include "opt_watchdog.h"
#include "opt_acpi.h"

#include <sys/param.h>
#include <sys/systm.h>
Expand Down Expand Up @@ -88,6 +89,10 @@ static struct mtx time_lock;
SDT_PROVIDER_DECLARE(sched);
SDT_PROBE_DEFINE2(sched, , , tick, "struct thread *", "struct proc *");

#ifdef DEV_ACPI
struct intr_event *clk_intr_event;
#endif

static int
sysctl_kern_cp_time(SYSCTL_HANDLER_ARGS)
{
Expand Down Expand Up @@ -529,7 +534,10 @@ hardclock(int cnt, int usermode)
if (i > 0 && i <= newticks)
watchdog_fire();
}
intr_event_handle(clk_intr_event, NULL);
#ifdef DEV_ACPI
if (!CK_SLIST_EMPTY(&clk_intr_event->ie_handlers))
intr_event_handle(clk_intr_event, NULL);
Comment on lines +538 to +539
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jrtc27 was objecting to this on #1358, due to looking inside struct intr_event. Issue would be, what approach should instead be used? Perhaps clock interrupts aren't considered stray if there are no handlers? Perhaps a flag to indicate no handler shouldn't be considered stray?

#endif
}
if (curcpu == CPU_FIRST())
cpu_tick_calibration();
Expand All @@ -547,6 +555,25 @@ hardclock_sync(int cpu)
*t = ticks;
}

/*
* Start standard software interrupt threads
*/
#ifdef DEV_ACPI
static void
start_softintr(void *dummy)
{

KASSERT(clk_intr_event == NULL, ("clk_intr_event non-NULL at %s()",
__func__));

if (swi_add(&clk_intr_event, "clk", NULL, NULL, SWI_CLOCK,
INTR_MPSAFE | INTR_MULTIPROC, NULL))
panic("died while creating clk swi ithread");
}
SYSINIT(start_softintr, SI_SUB_SOFTINTR, SI_ORDER_FIRST, start_softintr,
NULL);
#endif

/*
* Regular integer scaling formula without losing precision:
*/
Expand Down
Loading
Loading