-
Notifications
You must be signed in to change notification settings - Fork 728
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 optimization: split all the members of dpvs connection into two groups for its initialization. #598
base: devel
Are you sure you want to change the base?
Conversation
@@ -98,7 +98,6 @@ static struct dp_vs_conn *dp_vs_conn_alloc(enum dpvs_fwd_mode fwdmode, | |||
return NULL; | |||
} | |||
|
|||
memset(conn, 0, sizeof(struct dp_vs_conn)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it safe to use uninitialized dp_vs_conn? Did you examine every field of dp_vs_conn and check whether it may be used uninitialized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has been tested and no issue is found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think uninitialized dp_vs_conn is good idea. Someday add some field in dp_vs_conn, it may lead problem.
For uninitialized dp_vs_conn maybe we can do something in dp_vs_conn_free
before invoke rte_mempool_put
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fnat_seq needs to be initialized as 0, otherwise it brings the fault to tcp connections. Additionally, double assignment for the same field of dpvs connection is not good to CPS performance.
DPVS crashed after a 2-hours stress test using this patch. Traces show mbuf is tainted.
|
Which test case are you running? Do you have the backtrace in detail? |
I patched the codes to the lastest
|
Okay. We will duplicate this issue and fix it. |
It seems related to the below configuration and it is day 1 issue. Have you tested without the patch of this PR?
|
I tested the current |
I have figured out some solution which will be sent out soon. |
With this patch, TCP CPS can be increased by 10% with 14 CPU cores used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that many members of dp_vs_conn are still zerod with memset
. Are you sure the latest patch make 10% performance enhancement?
Besides, function pointer members (such as packet_xmit
, packet_out_xmit
) should always be zerod, because it's a disater if they are not assigned before use.
packet_xmit and packet_out_xmit() is initialized within dp_vs_conn_bind_dest() invoked by dp_vs_conn_new(). |
Please have a check on the latest patch. |
@andrewhit The latest patch itself is all OK now. But I'm concerned about its easy use and safety. For example, just as what you say, |
- TCP CPS can be increased by 10% for the single core with TCP flood traffic sent by hping3.
initialization and it's for the benefit of CPS. a) Remove the operation of bezeroing all the members of dpvs connection within dp_vs_conn_alloc(). b) Each member of dpvs connection is initialized ONCE via dp_vs_conn_pre_init() or dp_vs_conn_new(). - dp_vs_conn_pre_init() initializes all the members of one group as 0, but ack_mbuf. - dp_vs_conn_new() initializes all the members of the other group with the specific values.
sent by hping3.