Tetsuo Handa
c4f135d643
workqueue: Wrap flush_workqueue() using a macro
...
Since flush operation synchronously waits for completion, flushing
system-wide WQs (e.g. system_wq) might introduce possibility of deadlock
due to unexpected locking dependency. Tejun Heo commented at [1] that it
makes no sense at all to call flush_workqueue() on the shared WQs as the
caller has no idea what it's gonna end up waiting for.
Although there is flush_scheduled_work() which flushes system_wq WQ with
"Think twice before calling this function! It's very easy to get into
trouble if you don't take great care." warning message, syzbot found a
circular locking dependency caused by flushing system_wq WQ [2].
Therefore, let's change the direction to that developers had better use
their local WQs if flush_scheduled_work()/flush_workqueue(system_*_wq) is
inevitable.
Steps for converting system-wide WQs into local WQs are explained at [3],
and a conversion to stop flushing system-wide WQs is in progress. Now we
want some mechanism for preventing developers who are not aware of this
conversion from again start flushing system-wide WQs.
Since I found that WARN_ON() is complete but awkward approach for teaching
developers about this problem, let's use __compiletime_warning() for
incomplete but handy approach. For completeness, we will also insert
WARN_ON() into __flush_workqueue() after all in-tree users stopped calling
flush_scheduled_work().
Link: https://lore.kernel.org/all/YgnQGZWT%2Fn3VAITX@slm.duckdns.org/ [1]
Link: https://syzkaller.appspot.com/bug?extid=bde0f89deacca7c765b8 [2]
Link: https://lkml.kernel.org/r/49925af7-78a8-a3dd-bce6-cfc02e1a9236@I-love.SAKURA.ne.jp [3]
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp >
Signed-off-by: Tejun Heo <tj@kernel.org >
2022-06-07 07:07:14 -10:00
..
2022-06-03 11:48:47 -07:00
2022-05-18 00:08:27 +02:00
2022-05-19 22:15:51 +02:00
2022-05-18 21:21:05 +02:00
2022-05-07 22:55:49 +02:00
2022-06-03 11:48:47 -07:00
2022-06-03 11:36:34 -07:00
2022-05-10 16:03:52 +08:00
2022-06-03 11:48:47 -07:00
2022-06-05 09:12:28 -07:00
2022-06-03 11:36:34 -07:00
2022-05-26 14:51:38 -07:00
2022-06-02 15:23:54 -07:00
2022-06-03 10:02:52 -07:00
2022-04-26 14:05:21 +02:00
2022-05-24 14:31:29 -07:00
2022-06-05 10:47:06 -07:00
2022-05-22 20:44:29 +01:00
2022-05-03 13:47:36 +01:00
2022-05-13 14:49:38 +02:00
2022-06-03 16:13:25 -07:00
2022-06-02 15:23:54 -07:00
2022-06-03 11:48:47 -07:00
2022-05-19 12:25:40 -04:00
2022-06-03 11:17:49 -07:00
2022-05-30 11:30:16 -07:00
2022-04-29 14:51:46 +01:00
2022-05-17 15:03:36 -04:00
2022-05-02 14:06:20 -06:00
2022-05-23 13:56:39 -07:00
2022-06-03 06:52:58 -07:00
2022-06-03 10:14:48 -07:00
2022-05-02 14:06:20 -06:00
2022-05-28 06:15:27 -06:00
2022-06-03 10:25:56 -07:00
2022-05-02 14:06:20 -06:00
2022-04-26 17:58:51 -04:00
2022-05-10 17:50:40 -07:00
2022-05-23 14:31:28 -07:00
2022-05-25 12:22:58 -07:00
2022-05-20 15:29:00 -07:00
2022-05-09 23:12:34 -04:00
2022-05-23 17:51:12 -07:00
2022-05-15 18:31:28 -06:00
2022-05-13 07:20:13 -07:00
2022-04-28 23:16:17 -07:00
2022-05-31 14:10:54 -07:00
2022-05-08 01:33:06 -07:00
2022-05-08 01:33:06 -07:00
2022-04-26 14:32:00 +02:00
2022-05-27 12:34:44 +02:00
2022-04-27 20:22:19 +02:00
2022-06-03 20:09:29 +08:00
2022-04-29 14:37:59 -07:00
2022-05-13 16:48:57 -07:00
2022-05-16 13:37:59 -07:00
2022-06-01 15:55:25 -07:00
2022-05-17 18:24:39 +09:00
2022-05-16 13:37:59 -07:00
2022-06-03 11:48:47 -07:00
2022-05-25 16:18:27 -07:00
2022-05-09 11:33:38 +02:00
2022-05-24 16:33:20 +09:00
2022-06-03 11:48:47 -07:00
2022-05-13 17:03:40 +09:00
2022-05-19 14:08:55 -07:00
2022-05-19 14:09:54 +10:00
2022-05-14 18:49:01 -04:00
2022-05-14 18:47:28 -04:00
2022-06-03 06:52:57 -07:00
2022-05-12 10:49:23 +02:00
2022-06-04 19:00:05 -07:00
2022-05-18 00:11:17 +08:00
2022-05-09 16:18:54 -07:00
2022-05-18 15:07:43 +02:00
2022-05-01 16:39:36 -04:00
2022-05-29 10:31:36 -07:00
2022-05-13 07:20:18 -07:00
2022-05-26 12:32:41 -07:00
2022-05-13 16:48:55 -07:00
2022-06-01 11:50:42 +02:00
2022-05-04 11:05:54 +02:00
2022-05-19 14:08:49 -07:00
2022-05-28 11:27:17 -07:00
2022-05-22 11:32:31 -07:00
2022-06-03 11:48:47 -07:00
2022-05-13 15:14:56 +02:00
2022-05-13 15:14:56 +02:00
2022-05-24 11:11:13 -07:00
2022-05-11 07:40:47 -06:00
2022-05-24 19:55:07 -07:00
2022-05-20 12:27:17 +02:00
2022-05-12 10:00:03 -05:00
2022-05-12 10:00:03 -05:00
2022-05-31 11:36:57 +02:00
2022-05-09 23:12:33 -04:00
2022-05-27 12:34:44 +02:00
2022-05-10 14:42:06 -07:00
2022-04-29 14:36:58 -07:00
2022-04-27 10:57:33 -07:00
2022-05-31 14:10:54 -07:00
2022-05-19 14:08:50 -07:00
2022-05-26 21:12:59 -04:00
2022-05-19 14:08:54 -07:00
2022-05-02 14:06:20 -06:00
2022-05-26 14:20:14 -07:00
2022-05-06 15:59:39 +02:00
2022-05-27 11:22:03 -07:00
2022-05-24 08:46:37 +02:00
2022-05-27 21:24:19 -07:00
2022-05-03 16:09:03 -04:00
2022-05-23 13:27:58 +02:00
2022-05-24 13:09:13 -07:00
2022-05-23 14:45:24 -05:00
2022-05-01 17:45:35 +01:00
2022-05-19 14:08:53 -07:00
2022-05-13 16:48:56 -07:00
2022-05-13 07:20:17 -07:00
2022-05-13 07:20:10 -07:00
2022-05-13 07:20:11 -07:00
2022-05-27 11:40:49 -07:00
2022-04-28 23:16:14 -07:00
2022-05-13 07:20:13 -07:00
2022-05-12 10:29:41 -07:00
2022-05-19 23:25:48 -04:00
2022-05-09 16:21:44 -04:00
2022-04-28 16:31:10 +02:00
2022-05-05 18:25:57 -07:00
2022-05-22 21:51:54 +01:00
2022-05-24 19:55:07 -07:00
2022-05-17 13:32:46 -04:00
2022-05-31 17:09:30 -04:00
2022-05-26 12:32:41 -07:00
2022-05-31 17:09:24 -04:00
2022-06-04 14:04:27 -07:00
2022-05-19 19:30:30 +02:00
2022-05-19 20:24:56 -04:00
2022-05-18 18:54:17 +02:00
2022-05-09 15:44:21 +02:00
2022-05-24 10:36:38 -07:00
2022-05-22 15:59:54 +10:00
2022-05-03 16:48:14 +02:00
2022-05-03 11:53:15 -05:00
2022-04-29 09:53:52 +02:00
2022-05-26 12:32:41 -07:00
2022-05-13 07:20:13 -07:00
2022-05-24 19:55:07 -07:00
2022-06-03 11:48:47 -07:00
2022-05-13 07:20:18 -07:00
2022-05-09 12:09:30 +01:00
2022-04-29 14:38:01 -07:00
2022-06-03 11:48:47 -07:00
2022-05-19 20:16:05 +02:00
2022-05-04 15:40:22 +05:30
2022-05-30 11:37:26 -07:00
2022-05-22 11:32:30 -07:00
2022-05-18 15:53:52 +02:00
2022-05-26 12:32:41 -07:00
2022-06-03 11:17:49 -07:00
2022-05-19 16:58:16 -07:00
2022-05-10 09:48:08 +02:00
2022-05-11 14:33:44 -05:00
2022-05-19 16:54:15 +02:00
2022-05-10 10:40:26 -07:00
2022-05-30 11:37:26 -07:00
2022-05-05 13:22:34 +01:00
2022-05-19 14:08:54 -07:00
2022-05-06 09:51:33 +02:00
2022-05-09 15:37:36 +02:00
2022-06-03 16:13:25 -07:00
2022-04-28 18:22:53 +01:00
2022-05-03 14:11:58 -07:00
2022-05-24 11:29:34 -07:00
2022-05-22 21:03:01 +01:00
2022-05-19 18:24:47 +02:00
2022-05-16 11:46:44 -07:00
2022-05-13 07:20:10 -07:00
2022-05-11 14:33:17 -05:00
2022-06-03 10:34:34 -07:00
2022-06-02 10:15:05 -07:00
2022-05-26 12:32:41 -07:00
2022-05-02 10:48:40 +02:00
2022-04-29 21:11:15 -06:00
2022-05-03 10:20:57 -07:00
2022-05-08 01:33:08 -07:00
2022-05-01 13:20:03 +01:00
2022-05-12 15:35:29 +02:00
2022-05-12 10:49:23 +02:00
2022-05-19 14:08:50 -07:00
2022-05-27 09:33:45 -07:00
2022-05-27 09:33:45 -07:00
2022-05-03 10:15:06 +02:00
2022-04-30 08:39:32 -06:00
2022-05-19 12:11:51 +02:00
2022-06-03 11:17:49 -07:00
2022-05-13 23:59:23 +02:00
2022-05-19 23:46:13 +02:00
2022-05-13 07:20:11 -07:00
2022-06-03 11:48:47 -07:00
2022-05-08 01:33:07 -07:00
2022-05-11 13:32:56 -06:00
2022-05-24 08:41:18 -06:00
2022-05-31 12:44:28 -04:00
2022-05-31 12:45:10 -04:00
2022-05-31 12:45:10 -04:00
2022-05-19 14:08:53 -07:00
2022-05-03 08:02:09 -05:00
2022-05-07 22:55:48 +02:00
2022-06-07 07:07:14 -10:00
2022-05-26 16:57:20 -07:00