lkml.org 
[lkml]   [2024]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] workqueue: Fix rescuer task's name truncated
On Tue, Apr 23, 2024 at 12:55:22PM +0800, Wenchao Hao wrote:
> Hi Tejun and all:
>
> I added another logic in wq_worker_comm() to append worker's desc when
> worker is not attached to a work pool. I don't know why the origin
> logic only append worker's desc when worker is attached to a work pool,
> so I am not sure if it's safe to using worker here directly.

Hi Wenchao,

A worker description is always updated under the per-pool workqueue lock.
You can indeed use the rescuer's own description to store its associated
workqueue name - good idea. We know the caller of set_worker_desc() will
never touch a rescuer. For this unique rescuer case, if I understand
correctly, you can read a rescuer's description outside the per-pool
workqueue lock; albeit, you need to prevent a race with destroy_workqueue()
to avoid a use-after-free.


Kind regards,

--
Aaron Tomlin

\
 
 \ /
  Last update: 2024-04-24 09:13    [W:0.049 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site