History

Merge tag 'wq-for-6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq

Pull workqueue updates from Tejun Heo: "Fix statistic update race condition and a couple documentation updates" * tag 'wq-for-6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: fix typo in comment workqueue: Fix race condition in wq->stats incrementation workqueue: Better document teardown for delayed_work

Linus Torvalds committed 1 year ago

Commit 91ad2502 parents f1975e4 23227e72 files · +15 −2Browse files

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

Unified · Split

kernel/workqueue.c+14−1
@@ -3241,7 +3241,7 @@ __acquires(&pool->lock) · 3240 unmodified lines
3241 * point will only record its address.3241 * point will only record its address.
3242 */3242 */
3243 trace_workqueue_execute_end(work, worker->current_func);3243 trace_workqueue_execute_end(work, worker->current_func);
3244 pwq->stats[PWQ_STAT_COMPLETED]++;3244
3245 lock_map_release(&lockdep_map);3245 lock_map_release(&lockdep_map);
3246 if (!bh_draining)3246 if (!bh_draining)
3247 lock_map_release(pwq->wq->lockdep_map);3247 lock_map_release(pwq->wq->lockdep_map);
@@ -3272,6 +3272,8 @@ __acquires(&pool->lock) · 24 unmodified lines
3272 3272
3273 raw_spin_lock_irq(&pool->lock);3273 raw_spin_lock_irq(&pool->lock);
3274 3274
3275 pwq->stats[PWQ_STAT_COMPLETED]++;
3276
3275 /*3277 /*
3276 * In addition to %WQ_CPU_INTENSIVE, @worker may also have been marked3278 * In addition to %WQ_CPU_INTENSIVE, @worker may also have been marked
3277 * CPU intensive by wq_worker_tick() if @work hogged CPU longer than3279 * CPU intensive by wq_worker_tick() if @work hogged CPU longer than
@@ -5837,6 +5839,17 @@ static bool pwq_busy(struct pool_workqueue *pwq) · 2559 unmodified lines
5837 * @wq: target workqueue5839 * @wq: target workqueue
5838 *5840 *
5839 * Safely destroy a workqueue. All work currently pending will be done first.5841 * Safely destroy a workqueue. All work currently pending will be done first.
5842 *
5843 * This function does NOT guarantee that non-pending work that has been
5844 * submitted with queue_delayed_work() and similar functions will be done
5845 * before destroying the workqueue. The fundamental problem is that, currently,
5846 * the workqueue has no way of accessing non-pending delayed_work. delayed_work
5847 * is only linked on the timer-side. All delayed_work must, therefore, be
5848 * canceled before calling this function.
5849 *
5850 * TODO: It would be better if the problem described above wouldn't exist and
5851 * destroy_workqueue() would cleanly cancel all pending and non-pending
5852 * delayed_work.
5840 */5853 */
5841void destroy_workqueue(struct workqueue_struct *wq)5854void destroy_workqueue(struct workqueue_struct *wq)
5842{5855{

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t