Re: [PATCH v3 3/8] coresight: etm-perf: Flush workqueue before unloading module

Leo Yan <[email protected]>
Newsgroups org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Tue, Jul 28, 2026 at 04:00:15PM +0100, James Clark wrote:
> The work queue is never flushed on module unload, so pending work items
> can run after coresight-config is cleaned up or the .text section is
> unloaded. The global workqueue also can't be flushed manually, so change
> it to a local workqueue and flush it on exit.

Why can't we drop the workqueue if it introduces race conditions and
complexity? In particular, I don't see much benefit from deferring
the resource release.

According to the comment in __rb_free_aux(), the free_aux() callback
should never be called from atomic context. It should be safe to release
the resources directly from the free_aux() callback, without going
through a workqueue.

Thanks,
Leo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.