From bb6b32dd818fbf3e1c8f726a9330170a9e31a62b Mon Sep 17 00:00:00 2001 From: Will Andrews Date: Wed, 1 Oct 2014 14:35:52 +0000 Subject: [PATCH] Add sysctl to track the resource consumption of ACPI interrupts. Submitted by: gibbs MFC after: 1 month Sponsored by: Spectra Logic MFSpectraBSD: 636827 on 2012/09/28 --- sys/dev/acpica/Osd/OsdSchedule.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/dev/acpica/Osd/OsdSchedule.c b/sys/dev/acpica/Osd/OsdSchedule.c index d49f886c9b8..e998fee7860 100644 --- a/sys/dev/acpica/Osd/OsdSchedule.c +++ b/sys/dev/acpica/Osd/OsdSchedule.c @@ -59,6 +59,13 @@ static int acpi_max_tasks = ACPI_MAX_TASKS; SYSCTL_INT(_debug_acpi, OID_AUTO, max_tasks, CTLFLAG_RDTUN, &acpi_max_tasks, 0, "Maximum acpi tasks"); +/* + * Track and report the system's demand for task slots. + */ +static int acpi_tasks_hiwater; +SYSCTL_INT(_debug_acpi, OID_AUTO, tasks_hiwater, CTLFLAG_RD, + &acpi_tasks_hiwater, 1, "Peak demand for ACPI event task slots."); + /* * Allow the user to tune the number of task threads we start. It seems * some systems have problems with increased parallelism. @@ -151,6 +158,10 @@ acpi_task_enqueue(int priority, ACPI_OSD_EXEC_CALLBACK Function, void *Context) acpi_task_count++; break; } + + if (i > acpi_tasks_hiwater) + atomic_cmpset_int(&acpi_tasks_hiwater, acpi_tasks_hiwater, i); + if (at == NULL) { printf("AcpiOsExecute: failed to enqueue task, consider increasing " "the debug.acpi.max_tasks tunable\n");