diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 9cdf771b66edca3138090ac5b8396321df91d1ce..0de11444e317979a0e2bb38234b407d3cd31d04b 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -854,10 +854,16 @@ static void loop_unprepare_queue(struct loop_device *lo) kthread_stop(lo->worker_task); } +static int loop_kthread_worker_fn(void *worker_ptr) +{ + current->flags |= PF_LESS_THROTTLE; + return kthread_worker_fn(worker_ptr); +} + static int loop_prepare_queue(struct loop_device *lo) { kthread_init_worker(&lo->worker); - lo->worker_task = kthread_run(kthread_worker_fn, + lo->worker_task = kthread_run(loop_kthread_worker_fn, &lo->worker, "loop%d", lo->lo_number); if (IS_ERR(lo->worker_task)) return -ENOMEM;