Add the tunable "debug.acpi.max_threads" to allow users to set the
number of task threads to start on boot. Go back to a default of 3 threads to work around lost battery state problems. Users that need a setting of 1 can set this via the tunable. I am investigating the underlying issues and this tunable can be removed once they are solved. MFC after: 2 days
This commit is contained in:
parent
d56c5d4bec
commit
98cc161947
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=145352
@ -49,6 +49,13 @@
|
||||
#define _COMPONENT ACPI_OS_SERVICES
|
||||
ACPI_MODULE_NAME("SCHEDULE")
|
||||
|
||||
/*
|
||||
* Allow the user to tune the number of task threads we start. It seems
|
||||
* some systems have problems with increased parallelism.
|
||||
*/
|
||||
static int acpi_max_threads = ACPI_MAX_THREADS;
|
||||
TUNABLE_INT("debug.acpi.max_threads", &acpi_max_threads);
|
||||
|
||||
/*
|
||||
* This is a little complicated due to the fact that we need to build and then
|
||||
* free a 'struct task' for each task we enqueue.
|
||||
@ -130,7 +137,7 @@ acpi_task_thread_init(void)
|
||||
err = 0;
|
||||
STAILQ_INIT(&acpi_task_queue);
|
||||
|
||||
for (i = 0; i < ACPI_MAX_THREADS; i++) {
|
||||
for (i = 0; i < acpi_max_threads; i++) {
|
||||
err = kthread_create(acpi_task_thread, NULL, &acpi_kthread_proc,
|
||||
0, 0, "acpi_task%d", i);
|
||||
if (err != 0) {
|
||||
|
@ -421,9 +421,8 @@ int acpi_PkgGas(device_t dev, ACPI_OBJECT *res, int idx, int *type,
|
||||
int *rid, struct resource **dst);
|
||||
ACPI_HANDLE acpi_GetReference(ACPI_HANDLE scope, ACPI_OBJECT *obj);
|
||||
|
||||
#ifndef ACPI_MAX_THREADS
|
||||
#define ACPI_MAX_THREADS 1
|
||||
#endif
|
||||
/* Default number of task queue threads to start. */
|
||||
#define ACPI_MAX_THREADS 3
|
||||
|
||||
/* ACPI task kernel thread initialization. */
|
||||
int acpi_task_thread_init(void);
|
||||
|
Loading…
Reference in New Issue
Block a user