Commit ab1d0b6
committed
sched: Reverse runqueue order when CLZ is available
This commit reverses the runqueue_cache bit order when the architecture
has a CLZ (count leading zeros) instruction. When the architecture
supports CLZ, it is faster to determine the most significant set bit of
a word than to determine the least significant bit set. Unfortunately
when the instruction is not available, it is more efficient to determine
the least significant bit set.
Reversing the bit order shaves off another 4 cycles on the same54-xpro.
From 147 to 143 ticks when testing with tests/bench_sched_nop.
Architectures where no CLZ instruction is available are not affected.1 parent 01e6b62 commit ab1d0b6
1 file changed
+37
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
82 | 116 | | |
83 | 117 | | |
84 | 118 | | |
| |||
119 | 153 | | |
120 | 154 | | |
121 | 155 | | |
122 | | - | |
| 156 | + | |
123 | 157 | | |
124 | 158 | | |
125 | 159 | | |
| |||
173 | 207 | | |
174 | 208 | | |
175 | 209 | | |
176 | | - | |
| 210 | + | |
177 | 211 | | |
178 | 212 | | |
179 | 213 | | |
| |||
184 | 218 | | |
185 | 219 | | |
186 | 220 | | |
187 | | - | |
| 221 | + | |
188 | 222 | | |
189 | 223 | | |
190 | 224 | | |
| |||
0 commit comments