Commit b56c720
workqueue: Avoid nr_active manipulation in grabbing inactive items
Current try_to_grab_pending() activates the inactive item and
subsequently treats it as though it were a standard activated item.
This approach prevents duplicating handling logic for both active and
inactive items, yet the premature activation of an inactive item
triggers trace_workqueue_activate_work(), yielding an unintended user
space visible side effect.
And the unnecessary increment of the nr_active, which is not a simple
counter now, followed by a counteracted decrement, is inefficient and
complicates the code.
Just remove the nr_active manipulation code in grabbing inactive items.
Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
Signed-off-by: Tejun Heo <tj@kernel.org>1 parent 37c2277 commit b56c720
1 file changed
Lines changed: 9 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1683 | 1683 | | |
1684 | 1684 | | |
1685 | 1685 | | |
1686 | | - | |
1687 | | - | |
1688 | | - | |
1689 | | - | |
1690 | | - | |
1691 | | - | |
1692 | | - | |
1693 | | - | |
1694 | | - | |
1695 | | - | |
1696 | | - | |
1697 | | - | |
1698 | | - | |
1699 | | - | |
1700 | | - | |
1701 | | - | |
1702 | | - | |
1703 | | - | |
1704 | | - | |
1705 | | - | |
1706 | | - | |
1707 | | - | |
1708 | | - | |
1709 | | - | |
1710 | | - | |
1711 | | - | |
1712 | | - | |
1713 | 1686 | | |
1714 | 1687 | | |
1715 | 1688 | | |
| |||
2116 | 2089 | | |
2117 | 2090 | | |
2118 | 2091 | | |
2119 | | - | |
| 2092 | + | |
2120 | 2093 | | |
2121 | 2094 | | |
2122 | 2095 | | |
| |||
2125 | 2098 | | |
2126 | 2099 | | |
2127 | 2100 | | |
2128 | | - | |
| 2101 | + | |
2129 | 2102 | | |
2130 | 2103 | | |
2131 | | - | |
2132 | | - | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
2133 | 2109 | | |
2134 | | - | |
| 2110 | + | |
| 2111 | + | |
2135 | 2112 | | |
2136 | 2113 | | |
2137 | 2114 | | |
2138 | 2115 | | |
2139 | 2116 | | |
2140 | 2117 | | |
2141 | 2118 | | |
2142 | | - | |
2143 | 2119 | | |
2144 | 2120 | | |
2145 | 2121 | | |
| |||
0 commit comments