lkml.org 
[lkml]   [2020]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Re [PATCH] Adding multiple workers to the loop device.
From
Date
On 2020-01-21 12:10, muraliraja.muniraju wrote:
> + for (i = 0; i < lo->num_loop_workers; i++) {
> + kthread_init_worker(&(lo->workers[i]));
> + lo->worker_tasks[i] = kthread_run(
> + loop_kthread_worker_fn, &(lo->workers[i]),
> + "loop%d(%d)", lo->lo_number, i);
> + if (IS_ERR((lo->worker_tasks[i])))
> + goto err;
> + set_user_nice(lo->worker_tasks[i], MIN_NICE);
> + }

Unless if there is a really good reason, the workqueue mechanism should
be used instead of creating kthreads. And again unless if there is a
really good reason, one of the system workqueues (e.g. system_wq) should
be used instead of creating dedicated workqueues.

Bart.

\
 
 \ /
  Last update: 2020-01-22 05:03    [W:0.072 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site