History

workqueue: rename workqueue_lock to wq_mayday_lock

With the recent locking updates, the only thing protected by workqueue_lock is workqueue->maydays list. Rename workqueue_lock to wq_mayday_lock. This patch is pure rename.

Tejun Heo committed 13 years ago

Commit 2e109a21 parent 794b18b1 file · +12 −12Browse files

Showing the changes to kernel/workqueue.c (1 of 1 file). Show all

Unified · Split

kernel/workqueue.c+12−12
@@ -125,10 +125,10 @@ enum { · 124 unmodified lines
125125 *
126126 * PW: pwq_lock protected.
127127 *
128− * W: workqueue_lock protected.
129− *
130128 * FR: wq->flush_mutex and pwq_lock protected for writes. Sched-RCU
131129 * protected for reads.
130+ *
131+ * MD: wq_mayday_lock protected.
132132 */
133133
134134 /* struct worker is defined in workqueue_internal.h */
@@ -194,7 +194,7 @@ struct pool_workqueue { · 59 unmodified lines
194194 int max_active; /* L: max active works */
195195 struct list_head delayed_works; /* L: delayed works */
196196 struct list_head pwqs_node; /* FR: node on wq->pwqs */
197− struct list_head mayday_node; /* W: node on wq->maydays */
197+ struct list_head mayday_node; /* MD: node on wq->maydays */
198198
199199 /*
200200 * Release of unbound pwq is punted to system_wq. See put_pwq()
@@ -235,7 +235,7 @@ struct workqueue_struct { · 34 unmodified lines
235235 struct list_head flusher_queue; /* F: flush waiters */
236236 struct list_head flusher_overflow; /* F: flush overflow list */
237237
238− struct list_head maydays; /* W: pwqs requesting rescue */
238+ struct list_head maydays; /* MD: pwqs requesting rescue */
239239 struct worker *rescuer; /* I: rescue worker */
240240
241241 int nr_drainers; /* WQ: drain in progress */
@@ -254,7 +254,7 @@ static struct kmem_cache *pwq_cache; · 12 unmodified lines
254254
255255 static DEFINE_MUTEX(wq_mutex); /* protects workqueues and pools */
256256 static DEFINE_SPINLOCK(pwq_lock); /* protects pool_workqueues */
257−static DEFINE_SPINLOCK(workqueue_lock);
257+static DEFINE_SPINLOCK(wq_mayday_lock); /* protects wq->maydays list */
258258
259259 static LIST_HEAD(workqueues); /* WQ: list of all workqueues */
260260 static bool workqueue_freezing; /* WQ: have wqs started freezing? */
@@ -1894,7 +1894,7 @@ static void send_mayday(struct work_struct *work) · 1633 unmodified lines
18941894 struct pool_workqueue *pwq = get_work_pwq(work);
18951895 struct workqueue_struct *wq = pwq->wq;
18961896
1897− lockdep_assert_held(&workqueue_lock);
1897+ lockdep_assert_held(&wq_mayday_lock);
18981898
18991899 if (!wq->rescuer)
19001900 return;
@@ -1911,7 +1911,7 @@ static void pool_mayday_timeout(unsigned long __pool) · 10 unmodified lines
19111911 struct worker_pool *pool = (void *)__pool;
19121912 struct work_struct *work;
19131913
1914− spin_lock_irq(&workqueue_lock); /* for wq->maydays */
1914+ spin_lock_irq(&wq_mayday_lock); /* for wq->maydays */
19151915 spin_lock(&pool->lock);
19161916
19171917 if (need_to_create_worker(pool)) {
@@ -1926,7 +1926,7 @@ static void pool_mayday_timeout(unsigned long __pool) · 8 unmodified lines
19261926 }
19271927
19281928 spin_unlock(&pool->lock);
1929− spin_unlock_irq(&workqueue_lock);
1929+ spin_unlock_irq(&wq_mayday_lock);
19301930
19311931 mod_timer(&pool->mayday_timer, jiffies + MAYDAY_INTERVAL);
19321932 }
@@ -2404,7 +2404,7 @@ repeat: · 471 unmodified lines
24042404 }
24052405
24062406 /* see whether any pwq is asking for help */
2407− spin_lock_irq(&workqueue_lock);
2407+ spin_lock_irq(&wq_mayday_lock);
24082408
24092409 while (!list_empty(&wq->maydays)) {
24102410 struct pool_workqueue *pwq = list_first_entry(&wq->maydays,
@@ -2415,7 +2415,7 @@ repeat: · 4 unmodified lines
24152415 __set_current_state(TASK_RUNNING);
24162416 list_del_init(&pwq->mayday_node);
24172417
2418− spin_unlock_irq(&workqueue_lock);
2418+ spin_unlock_irq(&wq_mayday_lock);
24192419
24202420 /* migrate to the target cpu if possible */
24212421 worker_maybe_bind_and_lock(pool);
@@ -2442,10 +2442,10 @@ repeat: · 20 unmodified lines
24422442
24432443 rescuer->pool = NULL;
24442444 spin_unlock(&pool->lock);
2445− spin_lock(&workqueue_lock);
2445+ spin_lock(&wq_mayday_lock);
24462446 }
24472447
2448− spin_unlock_irq(&workqueue_lock);
2448+ spin_unlock_irq(&wq_mayday_lock);
24492449
24502450 /* rescuers should never participate in concurrency management */
24512451 WARN_ON_ONCE(!(rescuer->flags & WORKER_NOT_RUNNING));