diff options
Diffstat (limited to 'include/linux/workqueue.h')
-rw-r--r-- | include/linux/workqueue.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index b90958a037dc..8762f62103d8 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -26,11 +26,13 @@ enum { | |||
26 | WORK_STRUCT_PENDING_BIT = 0, /* work item is pending execution */ | 26 | WORK_STRUCT_PENDING_BIT = 0, /* work item is pending execution */ |
27 | #ifdef CONFIG_DEBUG_OBJECTS_WORK | 27 | #ifdef CONFIG_DEBUG_OBJECTS_WORK |
28 | WORK_STRUCT_STATIC_BIT = 1, /* static initializer (debugobjects) */ | 28 | WORK_STRUCT_STATIC_BIT = 1, /* static initializer (debugobjects) */ |
29 | WORK_STRUCT_FLAG_BITS = 2, | 29 | WORK_STRUCT_COLOR_SHIFT = 3, /* color for workqueue flushing */ |
30 | #else | 30 | #else |
31 | WORK_STRUCT_FLAG_BITS = 1, | 31 | WORK_STRUCT_COLOR_SHIFT = 2, /* color for workqueue flushing */ |
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | WORK_STRUCT_COLOR_BITS = 4, | ||
35 | |||
34 | WORK_STRUCT_PENDING = 1 << WORK_STRUCT_PENDING_BIT, | 36 | WORK_STRUCT_PENDING = 1 << WORK_STRUCT_PENDING_BIT, |
35 | #ifdef CONFIG_DEBUG_OBJECTS_WORK | 37 | #ifdef CONFIG_DEBUG_OBJECTS_WORK |
36 | WORK_STRUCT_STATIC = 1 << WORK_STRUCT_STATIC_BIT, | 38 | WORK_STRUCT_STATIC = 1 << WORK_STRUCT_STATIC_BIT, |
@@ -38,6 +40,21 @@ enum { | |||
38 | WORK_STRUCT_STATIC = 0, | 40 | WORK_STRUCT_STATIC = 0, |
39 | #endif | 41 | #endif |
40 | 42 | ||
43 | /* | ||
44 | * The last color is no color used for works which don't | ||
45 | * participate in workqueue flushing. | ||
46 | */ | ||
47 | WORK_NR_COLORS = (1 << WORK_STRUCT_COLOR_BITS) - 1, | ||
48 | WORK_NO_COLOR = WORK_NR_COLORS, | ||
49 | |||
50 | /* | ||
51 | * Reserve 6 bits off of cwq pointer w/ debugobjects turned | ||
52 | * off. This makes cwqs aligned to 64 bytes which isn't too | ||
53 | * excessive while allowing 15 workqueue flush colors. | ||
54 | */ | ||
55 | WORK_STRUCT_FLAG_BITS = WORK_STRUCT_COLOR_SHIFT + | ||
56 | WORK_STRUCT_COLOR_BITS, | ||
57 | |||
41 | WORK_STRUCT_FLAG_MASK = (1UL << WORK_STRUCT_FLAG_BITS) - 1, | 58 | WORK_STRUCT_FLAG_MASK = (1UL << WORK_STRUCT_FLAG_BITS) - 1, |
42 | WORK_STRUCT_WQ_DATA_MASK = ~WORK_STRUCT_FLAG_MASK, | 59 | WORK_STRUCT_WQ_DATA_MASK = ~WORK_STRUCT_FLAG_MASK, |
43 | }; | 60 | }; |