Commit d8b31e0
committed
Drain kqueue events to prevent WFI busy-loop
The poll()-based event loop was not consuming kqueue events on macOS,
causing the kqueue fd to remain readable after the first timer tick.
This defeated the WFI sleep optimization by making poll(..., -1) return
immediately instead of blocking when all harts are idle.
Root cause:
- Linux path: timerfd is consumed via read() after poll()
- macOS path: kqueue events were never drained after poll()
- Result: kqueue fd stays readable → poll() never blocks → 100% CPU1 parent c6a1d5f commit d8b31e0
1 file changed
+11
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1170 | 1170 | | |
1171 | 1171 | | |
1172 | 1172 | | |
1173 | | - | |
1174 | | - | |
1175 | | - | |
1176 | 1173 | | |
1177 | 1174 | | |
1178 | 1175 | | |
| |||
1207 | 1204 | | |
1208 | 1205 | | |
1209 | 1206 | | |
1210 | | - | |
1211 | | - | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
1212 | 1210 | | |
1213 | 1211 | | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
1214 | 1219 | | |
1215 | 1220 | | |
1216 | 1221 | | |
1217 | 1222 | | |
1218 | | - | |
1219 | 1223 | | |
| 1224 | + | |
1220 | 1225 | | |
1221 | 1226 | | |
1222 | 1227 | | |
| |||
0 commit comments