Re: RFC how to use kernel procs/threads efficiently

From: Julian Elischer <>
Date: Tue, 10 Oct 2017 10:47:30 +0800
On 10/10/17 4:25 am, Rick Macklem wrote:
> ________________________________________
> Ian Lepore wrote:
> [stuff snipped]
>> taskqueue(9) is an existing mechanism to enqueue functions to execute
>> asynch using a pool of threads, but it doesn't answer the scalability
>> questions.  In fact it may make them harder, inasmuch as I don't think
>> there's a mechanism to dynamically adjust the number of threads after
>> first calling taskqueue_start_threads().
> I've coded it using taskqueue and it seems to work ok.
> The patch is here, in case anyone would like to review it:
> I don't know what the overheads are (or even how to measure/compare
> them), but I suspect it is less than a kproc_create()/kproc_exit() for every
> RPC.
> I also don't think having a fixed # of threads is a problem. Since NFS I/O
> is so bursty, recent I/O activity doesn't give a good indication of how many
> threads will be needed soon. In other words, it can go from no I/O to
> heavy I/O and back to no I/O rapidly.
> --> As such, having a fixed reasonable # of threads is probably the best
>        that can be done.
>        - The current patch has the # of threads as a sysctl with a default of 32.
why not set it to ncpu or something?

> Thanks for your comments and feel free to review it, if you'd like, rick
> _______________________________________________
> mailing list
> To unsubscribe, send any mail to ""
Received on Tue Oct 10 2017 - 00:47:41 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:13 UTC