Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BBR: avoid busy loop #446

Merged
merged 2 commits into from
Feb 9, 2023
Merged

Conversation

zenhack
Copy link
Contributor

@zenhack zenhack commented Feb 9, 2023

...in the case where the connection is idle. Previously, if this branch
was taken then the select would always terminate immediately; we really
need it to block unless there's actually something to send.

This is probably a big part of the high cpu use we're seeing. Also: the requirement that the pipe be empty is probably why we are not seeing high CPU usage in tests.


Stacked on top of #445; review & merge that first.

There's no actual reason for this, since the relevant select has a
default branch and therefore will never block.

This isn't the select at issue in the profile Louis showed me, but
it seems worth fixing since I've noticed it.
...in the case where the connection is idle. Previously, if this branch
was taken then the select would always terminate immediately; we really
need it to block unless there's actually something to send.

This is probably a big part of the high cpu use we're seeing.
@@ -84,9 +79,7 @@ func (l *Limiter) run(ctx context.Context) {
// might be in the far future, and there is no ack on its way
// to save us from our ignorance. Fortunately we always want
// to send if there's nothing on the wire, so just do it.
// Note that we don't use sendReqs here, since we don't want
// to skip over the logic that checks for app limited flows:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea what my reasoning was with this comment, but it makes no sense as a justification, since either way the probability of choosing other branches of the select is non-zero.

I want to stare at this a bit more; I wonder if there's some bookkeeping that I knew we needed to be doing here, but apparently failed at actually ensuring we did? I'll have to have a look when we revisit fixing the estimation problems.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this seems like a thread worth pulling on. Want to open an issue to track it, or are you confident you'll remember?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants