Use boot_ncpus in place of max_ncpus in taskq_create

Due to hotplug support or BIOS bugs sometimes max_ncpus can be
an absurdly high value. I have a system with 32 cores/threads
but reports max_ncpus == 440. This many threads potentially
cripples the system during arc_prune floods for example.

boot_ncpus is the number of working CPUs when called so use
that instead.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: DHE <git@dehacked.net>
Closes #10282
This commit is contained in:
DeHackEd
2020-05-20 13:07:21 -04:00
committed by GitHub
parent de4f06c275
commit 57434abae6
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -453,7 +453,7 @@ txg_dispatch_callbacks(dsl_pool_t *dp, uint64_t txg)
* Commit callback taskq hasn't been created yet.
*/
tx->tx_commit_cb_taskq = taskq_create("tx_commit_cb",
max_ncpus, defclsyspri, max_ncpus, max_ncpus * 2,
boot_ncpus, defclsyspri, boot_ncpus, boot_ncpus * 2,
TASKQ_PREPOPULATE | TASKQ_DYNAMIC);
}