Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177897407
D60374.1795542002.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D60374.1795542002.diff
View Options
diff --git a/sys/dev/acpica/Osd/OsdSchedule.c b/sys/dev/acpica/Osd/OsdSchedule.c
--- a/sys/dev/acpica/Osd/OsdSchedule.c
+++ b/sys/dev/acpica/Osd/OsdSchedule.c
@@ -50,7 +50,7 @@
/*
* Allow the user to tune the maximum number of tasks we may enqueue.
*/
-static int acpi_max_tasks = ACPI_MAX_TASKS;
+static int acpi_max_tasks = -1;
SYSCTL_INT(_debug_acpi, OID_AUTO, max_tasks, CTLFLAG_RDTUN, &acpi_max_tasks,
0, "Maximum acpi tasks");
@@ -94,8 +94,12 @@
static void
acpi_task_init(void *arg)
{
+ /*
+ * Static init value is -1. Override any negative value passed by the
+ * tunable. ACPI_MAX_TASKS depends on 'mp_ncpus'.
+ */
if (acpi_max_tasks < 0)
- acpi_max_tasks = 0;
+ acpi_max_tasks = ACPI_MAX_TASKS;
acpi_tasks = malloc(sizeof(*acpi_tasks) * acpi_max_tasks, M_ACPITASK,
M_WAITOK | M_ZERO);
@@ -166,8 +170,9 @@
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");
+ printf("AcpiOsExecute: Failed to enqueue task, consider increasing "
+ "the 'debug.acpi.max_tasks' tunable\n"
+ "AcpiOsExecute: and reporting 'debug.acpi.tasks_hiwater'.\n");
return (AE_NO_MEMORY);
}
diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h
--- a/sys/dev/acpica/acpivar.h
+++ b/sys/dev/acpica/acpivar.h
@@ -31,8 +31,6 @@
#ifdef _KERNEL
-#include "acpi_if.h"
-#include "bus_if.h"
#include <sys/_eventhandler.h>
#ifdef INTRNG
#include <sys/intr.h>
@@ -42,12 +40,17 @@
#include <sys/mutex.h>
#include <sys/power.h>
#include <sys/selinfo.h>
+#include <sys/smp.h> /* For 'mp_ncpus'. */
#include <sys/sx.h>
#include <sys/sysctl.h>
#include <machine/bus.h>
#include <machine/resource.h>
+#include "acpi_if.h"
+#include "bus_if.h"
+
+
struct acpi_softc {
device_t acpi_dev;
struct cdev *acpi_dev_t;
@@ -561,7 +564,7 @@
/* Default maximum number of tasks to enqueue. */
#ifndef ACPI_MAX_TASKS
-#define ACPI_MAX_TASKS MAX(32, MAXCPU * 4)
+#define ACPI_MAX_TASKS (64 + mp_ncpus * 4)
#endif
/* Default number of task queue threads to start. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 24, 5:40 PM (18 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41959463
Default Alt Text
D60374.1795542002.diff (2 KB)
Attached To
Mode
D60374: acpi: Tasks: Size the number of tasks with the actual number of CPUs
Attached
Detach File
Event Timeline