|
@@ -1916,6 +1916,12 @@ static void send_mayday(struct work_struct *work)
|
|
|
|
|
|
/* mayday mayday mayday */
|
|
|
if (list_empty(&pwq->mayday_node)) {
|
|
|
+ /*
|
|
|
+ * If @pwq is for an unbound wq, its base ref may be put at
|
|
|
+ * any time due to an attribute change. Pin @pwq until the
|
|
|
+ * rescuer is done with it.
|
|
|
+ */
|
|
|
+ get_pwq(pwq);
|
|
|
list_add_tail(&pwq->mayday_node, &wq->maydays);
|
|
|
wake_up_process(wq->rescuer->task);
|
|
|
}
|
|
@@ -2449,6 +2455,12 @@ repeat:
|
|
|
|
|
|
process_scheduled_works(rescuer);
|
|
|
|
|
|
+ /*
|
|
|
+ * Put the reference grabbed by send_mayday(). @pool won't
|
|
|
+ * go away while we're holding its lock.
|
|
|
+ */
|
|
|
+ put_pwq(pwq);
|
|
|
+
|
|
|
/*
|
|
|
* Leave this pool. If keep_working() is %true, notify a
|
|
|
* regular worker; otherwise, we end up with 0 concurrency
|