lkml.org 
[lkml]   [2023]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 2/4] workqueue: support holding a mutex for each work
On Wed, May 10, 2023 at 06:04:26PM +0200, Johannes Berg wrote:
> @@ -2387,7 +2389,13 @@ __acquires(&pool->lock)
> */
> lockdep_invariant_state(true);
> trace_workqueue_execute_start(work);
> - worker->current_func(work);
> + if (unlikely(pwq->wq->work_mutex)) {
> + mutex_lock(pwq->wq->work_mutex);
> + worker->current_func(work);
> + mutex_unlock(pwq->wq->work_mutex);
> + } else {
> + worker->current_func(work);
> + }

Ah, I don't know about this. This can't be that difficult to do from the
callee side, right?

Thanks.

--
tejun

\
 
 \ /
  Last update: 2023-05-10 20:35    [W:1.292 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site