Skip to content

Commit 86ac54e

Browse files
committed
Merge branch 'for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
Pull workqueue updates from Tejun Heo: "There is a long-standing subtle destroy_workqueue() bug where a workqueue can be destroyed while internal work items used for flushing are still in flight. Lai fixed it by assigning a flush color to the internal work items so that they are correctly waited for during destruction. Other than that, all are minor cleanups" * 'for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: Remove unused WORK_NO_COLOR workqueue: Assign a color to barrier work items workqueue: Mark barrier work with WORK_STRUCT_INACTIVE workqueue: Change the code of calculating work_flags in insert_wq_barrier() workqueue: Change arguement of pwq_dec_nr_in_flight() workqueue: Rename "delayed" (delayed by active management) to "inactive" workqueue: Replace deprecated CPU-hotplug functions. workqueue: Replace deprecated ida_simple_*() with ida_alloc()/ida_free() workqueue: Fix typo in comments workqueue: Fix possible memory leaks in wq_numa_init()
2 parents 69dc801 + bdb0a65 commit 86ac54e

File tree

3 files changed

+116
-88
lines changed

3 files changed

+116
-88
lines changed

include/linux/workqueue.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void delayed_work_timer_fn(struct timer_list *t);
2929

3030
enum {
3131
WORK_STRUCT_PENDING_BIT = 0, /* work item is pending execution */
32-
WORK_STRUCT_DELAYED_BIT = 1, /* work item is delayed */
32+
WORK_STRUCT_INACTIVE_BIT= 1, /* work item is inactive */
3333
WORK_STRUCT_PWQ_BIT = 2, /* data points to pwq */
3434
WORK_STRUCT_LINKED_BIT = 3, /* next work is linked to this one */
3535
#ifdef CONFIG_DEBUG_OBJECTS_WORK
@@ -42,7 +42,7 @@ enum {
4242
WORK_STRUCT_COLOR_BITS = 4,
4343

4444
WORK_STRUCT_PENDING = 1 << WORK_STRUCT_PENDING_BIT,
45-
WORK_STRUCT_DELAYED = 1 << WORK_STRUCT_DELAYED_BIT,
45+
WORK_STRUCT_INACTIVE = 1 << WORK_STRUCT_INACTIVE_BIT,
4646
WORK_STRUCT_PWQ = 1 << WORK_STRUCT_PWQ_BIT,
4747
WORK_STRUCT_LINKED = 1 << WORK_STRUCT_LINKED_BIT,
4848
#ifdef CONFIG_DEBUG_OBJECTS_WORK
@@ -51,19 +51,14 @@ enum {
5151
WORK_STRUCT_STATIC = 0,
5252
#endif
5353

54-
/*
55-
* The last color is no color used for works which don't
56-
* participate in workqueue flushing.
57-
*/
58-
WORK_NR_COLORS = (1 << WORK_STRUCT_COLOR_BITS) - 1,
59-
WORK_NO_COLOR = WORK_NR_COLORS,
54+
WORK_NR_COLORS = (1 << WORK_STRUCT_COLOR_BITS),
6055

6156
/* not bound to any CPU, prefer the local CPU */
6257
WORK_CPU_UNBOUND = NR_CPUS,
6358

6459
/*
6560
* Reserve 8 bits off of pwq pointer w/ debugobjects turned off.
66-
* This makes pwqs aligned to 256 bytes and allows 15 workqueue
61+
* This makes pwqs aligned to 256 bytes and allows 16 workqueue
6762
* flush colors.
6863
*/
6964
WORK_STRUCT_FLAG_BITS = WORK_STRUCT_COLOR_SHIFT +
@@ -324,7 +319,7 @@ enum {
324319
* to execute and tries to keep idle cores idle to conserve power;
325320
* however, for example, a per-cpu work item scheduled from an
326321
* interrupt handler on an idle CPU will force the scheduler to
327-
* excute the work item on that CPU breaking the idleness, which in
322+
* execute the work item on that CPU breaking the idleness, which in
328323
* turn may lead to more scheduling choices which are sub-optimal
329324
* in terms of power consumption.
330325
*

0 commit comments

Comments
 (0)