Page MenuHomeFreeBSD

D60374.1795541160.diff
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

D60374.1795541160.diff

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

Mime Type
text/plain
Expires
Tue, Nov 24, 5:26 PM (19 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41959463
Default Alt Text
D60374.1795541160.diff (2 KB)

Event Timeline