Commit d55ecea
committed
runtime: usleep before stealing runnext only if not in syscall
In the scheduler's steal path, we usleep(3) before stealing a _Prunning
P's runnext slot. Before CL 646198, we would not call usleep(3) if the P
was in _Psyscall. After CL 646198, Ps with Gs in syscalls stay in
_Prunning until stolen, meaning we might unnecessarily usleep(3) where
we didn't before. This probably isn't a huge deal in most cases, but can
cause some apparent slowdowns in microbenchmarks that frequently take
the steal path while there are syscalling goroutines.
Change-Id: I5bf3df10fe61cf8d7f0e9fe9522102de66faf344
Reviewed-on: https://go-review.googlesource.com/c/go/+/720441
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Michael Pratt <[email protected]>1 parent 410ef44 commit d55ecea
1 file changed
+30
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7507 | 7507 | | |
7508 | 7508 | | |
7509 | 7509 | | |
7510 | | - | |
7511 | | - | |
7512 | | - | |
7513 | | - | |
7514 | | - | |
7515 | | - | |
7516 | | - | |
7517 | | - | |
7518 | | - | |
7519 | | - | |
7520 | | - | |
7521 | | - | |
7522 | | - | |
7523 | | - | |
7524 | | - | |
7525 | | - | |
7526 | | - | |
| 7510 | + | |
| 7511 | + | |
| 7512 | + | |
| 7513 | + | |
| 7514 | + | |
| 7515 | + | |
| 7516 | + | |
| 7517 | + | |
| 7518 | + | |
| 7519 | + | |
| 7520 | + | |
| 7521 | + | |
| 7522 | + | |
| 7523 | + | |
| 7524 | + | |
| 7525 | + | |
| 7526 | + | |
| 7527 | + | |
| 7528 | + | |
| 7529 | + | |
| 7530 | + | |
| 7531 | + | |
| 7532 | + | |
| 7533 | + | |
| 7534 | + | |
| 7535 | + | |
| 7536 | + | |
| 7537 | + | |
| 7538 | + | |
| 7539 | + | |
7527 | 7540 | | |
7528 | 7541 | | |
7529 | 7542 | | |
| |||
0 commit comments