lkml.org 
[lkml]   [2022]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] checkpatch: warn about flushing system-wide workqueues
From
On 2022/05/06 2:32, Tejun Heo wrote:
> Given that we'll need runtime check anyway, why not resurrect the original
> runtime warning but exempt flush_schedule_work() if that's the only thing
> remaining right now (using a special flag or whatever)?

Yes, we will also need runtime check for robustness, for we can't catch usage
like

struct workqueue_struct *my_wq = alloc_workqueue();
if (!my_wq)
my_wq = system_long_wq;
flush_workqueue(my_wq);

using compile time checks.

I found that it is not easy to trigger flush_workqueue() paths. For example,
several modules are using flush_workqueue() only upon module unloading.
Therefore, I'm trying to catch obvious flush_workqueue() paths at compile
time when possible.

> If we're sure that
> we aren't triggering it spuriously, we can ask Andrew to take the warning
> patch into -mm so that it floats on top of everything else and gets pulled
> into the trunk during the coming merge window.

OK, the coming merge window means 5.19.

The original runtime checking will be used anyway. Is "workqueue: Wrap
flush_workqueue() using a macro" OK for you as a compile time check?

\
 
 \ /
  Last update: 2022-05-06 01:30    [W:0.105 / U:3.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site