Skip to content

Extended Utility Codel#475

Merged
apanda merged 1 commit into
NetSys:masterfrom
TheJStone:codel_factory
Jun 16, 2017
Merged

Extended Utility Codel#475
apanda merged 1 commit into
NetSys:masterfrom
TheJStone:codel_factory

Conversation

@TheJStone

Copy link
Copy Markdown
Contributor

Adds Factory, Generator and Resize methods(as well as a few minor fixups) to Utility Codel in order to allow integration into DRR.

@codecov

codecov Bot commented May 25, 2017

Copy link
Copy Markdown

Codecov Report

Merging #475 into master will decrease coverage by 0.07%.
The diff coverage is 73.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #475      +/-   ##
==========================================
- Coverage   65.33%   65.26%   -0.08%     
==========================================
  Files         198      198              
  Lines       12261    12311      +50     
==========================================
+ Hits         8011     8035      +24     
- Misses       4250     4276      +26
Impacted Files Coverage Δ
core/utils/queue.h 100% <ø> (ø) ⬆️
core/utils/codel.h 77.14% <0%> (-8.13%) ⬇️
core/utils/codel_test.cc 100% <100%> (ø) ⬆️
core/utils/llqueue_test.cc 100% <100%> (ø) ⬆️
core/utils/lock_less_queue.h 84.44% <81.25%> (+1.68%) ⬆️
core/modules/nat.cc 70.22% <0%> (-11.46%) ⬇️
core/modules/source.cc 76.31% <0%> (+0.64%) ⬆️
core/modules/queue.cc 61.81% <0%> (+0.9%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4f9fa25...6b47981. Read the comment docs.

@apanda apanda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I left some code comments, but I must admit I am entirely unsure about the context of this change. Do you mind adding something to the PR or to one of the commit messages describing what you are trying to achieve with this change?

Comment thread core/utils/codel.h Outdated
}

size_t Capacity() override { return queue_.max_size(); }
size_t Capacity() override {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is Codel's capacity different from the underlying queue capacity. We have already allocated memory (based on the Resize method below). It would be good to at least add a comment explaining this choice, since the current code is surprising.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I switched the underlying queue to deque which has a max size of the memory available to it according to the spec and I didn't see any constructor parameter to limit the deque size. In the use case of having many codels in drr handling a burst, it would be better to restrict queue size rather than have issues with memory although the max_entries can be specified as 0 to default to the memory size. I will add a comment but is allowing restriction not a good idea?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That is OK, just add a comment with the reason you gave above.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The restriction is fine -- I think it needs to be documented. I am not super sure how one picks max_size_ -- it seems to depend on the workload, but c'est la vie.

Comment thread core/utils/codel.h
if (new_capacity <= Size()) {
return -1;
} else if (new_capacity >= queue_.max_size()) {
return -1;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why does this method fail here, rather than calling queue_.resize?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I changed the underlying queue to be deque so the max_size is the max number of entries that the queue can have given system limitations.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just document it -- it looks strange to have a resize method which mostly does nothing.

@barath

barath commented Jun 12, 2017

Copy link
Copy Markdown
Contributor

Just wanted to follow up -- Josh, do you think you're pretty much done making the changes Panda asked about? If so, we can merge this in the next day or two.

@TheJStone

Copy link
Copy Markdown
Contributor Author

ya, I can finish it up tonight and push. I will ping you when I do.

@apanda apanda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@apanda
apanda merged commit 7728eaa into NetSys:master Jun 16, 2017
@apanda

apanda commented Jun 16, 2017

Copy link
Copy Markdown
Member

Merged, thanks!
image

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.

3 participants