[RFC] Simplify flush_workqueue/destroy_workqueue pattern

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

According to description of 'destroy_workqueue()':
   "Safely destroy a workqueue. All work currently pending will be done first"

Looking deeper at the code, it turns out that the call chain is:
       destroy_workqueue
   --> drain_workqueue
   --> flush_workqueue

So, calling explicitly 'flush_workqueue()' before 'destroy_workqueue()' looks redundant.

Using following coccinelle script spots ~90 occurrences, in ~80 files, which can be simplified.

>>>>>>>>>>>>>>>
@r@
expression e;
@@
-    flush_workqueue(e);
     destroy_workqueue(e);
>>>>>>>>>>>>>>>

This is way to much for me because my patch submission process is mainly manual.

If you agree with my analysis, think that removing these redundant calls is useful and have a much more automated patch submission process than me (or just have time :), please feel free to submit patches.

Best regards,
CJ





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux