@@ -569,59 +569,21 @@ static inline bool schedule_work(struct work_struct *work)
569
569
570
570
/*
571
571
* Detect attempt to flush system-wide workqueues at compile time when possible.
572
+ * Warn attempt to flush system-wide workqueues at runtime.
572
573
*
573
574
* See https://lkml.kernel.org/r/[email protected]
574
575
* for reasons and steps for converting system-wide workqueues into local workqueues.
575
576
*/
576
577
extern void __warn_flushing_systemwide_wq (void )
577
578
__compiletime_warning ("Please avoid flushing system-wide workqueues." );
578
579
579
- /**
580
- * flush_scheduled_work - ensure that any scheduled work has run to completion.
581
- *
582
- * Forces execution of the kernel-global workqueue and blocks until its
583
- * completion.
584
- *
585
- * It's very easy to get into trouble if you don't take great care.
586
- * Either of the following situations will lead to deadlock:
587
- *
588
- * One of the work items currently on the workqueue needs to acquire
589
- * a lock held by your code or its caller.
590
- *
591
- * Your code is running in the context of a work routine.
592
- *
593
- * They will be detected by lockdep when they occur, but the first might not
594
- * occur very often. It depends on what work items are on the workqueue and
595
- * what locks they need, which you have no control over.
596
- *
597
- * In most situations flushing the entire workqueue is overkill; you merely
598
- * need to know that a particular work item isn't queued and isn't running.
599
- * In such cases you should use cancel_delayed_work_sync() or
600
- * cancel_work_sync() instead.
601
- *
602
- * Please stop calling this function! A conversion to stop flushing system-wide
603
- * workqueues is in progress. This function will be removed after all in-tree
604
- * users stopped calling this function.
605
- */
606
- /*
607
- * The background of commit 771c035372a036f8 ("deprecate the
608
- * '__deprecated' attribute warnings entirely and for good") is that,
609
- * since Linus builds all modules between every single pull he does,
610
- * the standard kernel build needs to be _clean_ in order to be able to
611
- * notice when new problems happen. Therefore, don't emit warning while
612
- * there are in-tree users.
613
- */
580
+ /* Please stop using this function, for this function will be removed in near future. */
614
581
#define flush_scheduled_work () \
615
582
({ \
616
- if (0) \
617
- __warn_flushing_systemwide_wq(); \
583
+ __warn_flushing_systemwide_wq(); \
618
584
__flush_workqueue(system_wq); \
619
585
})
620
586
621
- /*
622
- * Although there is no longer in-tree caller, for now just emit warning
623
- * in order to give out-of-tree callers time to update.
624
- */
625
587
#define flush_workqueue (wq ) \
626
588
({ \
627
589
struct workqueue_struct *_wq = (wq); \
0 commit comments