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

Performance issue caused by invoking 'rte_malloc' frequently. #595

Draft
wants to merge 3 commits into
base: devel
Choose a base branch
from

Conversation

flyinskyabc
Copy link

  1. Deprecate 'rte_malloc', use 'rte_mempool_get' for inserting UOA instead.
  2. Remove unnecessary reference counting for 'struct inet_device'.

1. Deprecate 'rte_malloc', use 'rte_mempool_get' for inserting UOA instead.
2. Remove unnecessary reference counting for 'struct inet_device'.
0, NULL, NULL, NULL, NULL, i, 0);

if (unlikely(!g_uoa_cache[i])) {
return EDPVS_NOMEM;
Copy link
Collaborator

Choose a reason for hiding this comment

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

free previous uoa_cache memory before return

@ywc689 ywc689 added pr/needs-confirmed the feature in the pr is what we need,and list what cases should be checked in later stages pr/codes-need-change problems found in the line-by-line code review and need to be fixed labels Jul 20, 2020
Copy link
Collaborator

@ywc689 ywc689 left a comment

Choose a reason for hiding this comment

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

Codes are OK now. But mempool of the same size with dp_vs_conn may not memory friendly enough.

Actually, we are planning to fix rte_malloc problem in all critical packet pathes using dpvs's mempool, which supports variable length mempool and provides a balance between rte_malloc and dpdk mempool.You could help us with the plan if you are interested with it.

@ywc689 ywc689 added pr/codes-reviewed-ok code review passed and no problem found pr/do-not-need the feature in the pr is what do not need and removed pr/codes-need-change problems found in the line-by-line code review and need to be fixed pr/needs-confirmed the feature in the pr is what we need,and list what cases should be checked in later stages labels Aug 6, 2020
@ywc689 ywc689 marked this pull request as draft August 6, 2020 03:30
@@ -177,8 +181,8 @@ static int udp_conn_sched(struct dp_vs_proto *proto,
if ((*conn)->dest->fwdmode == DPVS_FWD_MODE_FNAT && g_uoa_max_trail > 0) {
struct conn_uoa *uoa;

(*conn)->prot_data = rte_zmalloc(NULL, sizeof(struct conn_uoa), 0);
if (!(*conn)->prot_data) {
err = rte_mempool_get(this_uoa_cache, (void **)&((*conn)->prot_data));
Copy link
Contributor

Choose a reason for hiding this comment

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

for now, struct conn_uoa has 6 bytes only, maybe use prot_data directly
uoa = (void*)&(*conn)->prot_data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/codes-reviewed-ok code review passed and no problem found pr/do-not-need the feature in the pr is what do not need
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants