|
@@ -87,7 +87,8 @@ enum {
|
|
/*
|
|
/*
|
|
* Structure fields follow one of the following exclusion rules.
|
|
* Structure fields follow one of the following exclusion rules.
|
|
*
|
|
*
|
|
- * I: Set during initialization and read-only afterwards.
|
|
|
|
|
|
+ * I: Modifiable by initialization/destruction paths and read-only for
|
|
|
|
+ * everyone else.
|
|
*
|
|
*
|
|
* P: Preemption protected. Disabling preemption is enough and should
|
|
* P: Preemption protected. Disabling preemption is enough and should
|
|
* only be modified and accessed from the local cpu.
|
|
* only be modified and accessed from the local cpu.
|
|
@@ -944,6 +945,9 @@ static void __queue_work(unsigned int cpu, struct workqueue_struct *wq,
|
|
|
|
|
|
debug_work_activate(work);
|
|
debug_work_activate(work);
|
|
|
|
|
|
|
|
+ if (WARN_ON_ONCE(wq->flags & WQ_DYING))
|
|
|
|
+ return;
|
|
|
|
+
|
|
/* determine gcwq to use */
|
|
/* determine gcwq to use */
|
|
if (!(wq->flags & WQ_UNBOUND)) {
|
|
if (!(wq->flags & WQ_UNBOUND)) {
|
|
struct global_cwq *last_gcwq;
|
|
struct global_cwq *last_gcwq;
|
|
@@ -2828,6 +2832,7 @@ void destroy_workqueue(struct workqueue_struct *wq)
|
|
{
|
|
{
|
|
unsigned int cpu;
|
|
unsigned int cpu;
|
|
|
|
|
|
|
|
+ wq->flags |= WQ_DYING;
|
|
flush_workqueue(wq);
|
|
flush_workqueue(wq);
|
|
|
|
|
|
/*
|
|
/*
|