Commit 891c0da
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 494d765 commit 891c0da
1 file changed
+11
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1145 | 1145 | | |
1146 | 1146 | | |
1147 | 1147 | | |
1148 | | - | |
1149 | | - | |
1150 | | - | |
1151 | 1148 | | |
1152 | 1149 | | |
1153 | 1150 | | |
| |||
1182 | 1179 | | |
1183 | 1180 | | |
1184 | 1181 | | |
1185 | | - | |
1186 | | - | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
1187 | 1185 | | |
1188 | 1186 | | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
1189 | 1194 | | |
1190 | 1195 | | |
1191 | 1196 | | |
1192 | 1197 | | |
1193 | | - | |
1194 | 1198 | | |
| 1199 | + | |
1195 | 1200 | | |
1196 | 1201 | | |
1197 | 1202 | | |
| |||
0 commit comments