aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAymeric Wibo <obiwac@FreeBSD.org>2025-12-29 20:01:50 +0000
committerAymeric Wibo <obiwac@FreeBSD.org>2026-01-08 10:35:54 +0000
commitc0df8f6f0e6a5f77ec9140e8075d09c55fe4c3c7 (patch)
tree1e26751967a083faabe09d655bb391469a6fb2fe
parent65e77d34fdff9065616cfaedef3ef53329cdad26 (diff)
acpi: Make taskqueue only run on BSP
This is needed because when we add the suspend-to-idle loop, we only want to break the BSP out of idle to process the taskqueue while keeping all the others idled. Currently assuming BSP to be CPU0, which may not always be the case on non-x86. Reviewed by: kib Approved by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54406
-rw-r--r--sys/dev/acpica/Osd/OsdSchedule.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/acpica/Osd/OsdSchedule.c b/sys/dev/acpica/Osd/OsdSchedule.c
index f0464709e8ad..0c5eadb87687 100644
--- a/sys/dev/acpica/Osd/OsdSchedule.c
+++ b/sys/dev/acpica/Osd/OsdSchedule.c
@@ -35,6 +35,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
+#include <sys/cpuset.h>
#include <sys/kernel.h>
#include <sys/kthread.h>
#include <sys/malloc.h>
@@ -109,10 +110,13 @@ static void
acpi_taskq_init(void *arg)
{
int i;
+ /* XXX Currently assuming BSP is CPU0. */
+ cpuset_t just_bsp = CPUSET_T_INITIALIZER(0x1);
acpi_taskq = taskqueue_create_fast("acpi_task", M_NOWAIT,
&taskqueue_thread_enqueue, &acpi_taskq);
- taskqueue_start_threads(&acpi_taskq, acpi_max_threads, PWAIT, "acpi_task");
+ taskqueue_start_threads_cpuset(&acpi_taskq, acpi_max_threads, PWAIT,
+ &just_bsp, "acpi_task");
if (acpi_task_count > 0) {
if (bootverbose)
printf("AcpiOsExecute: enqueue %d pending tasks\n",