Last fixes according 1715#2651
Conversation
|
The name of branch is euqal to the appropriate branch in tempesta-test repository. |
3729ce1 to
7df7a34
Compare
- Rename `client_mem_cache` to `tfw_client_mem_cache`. - Change `in_free_list` from struct list_head to pointer to save 8 bytes. - Implement 1GB mem limit by default. - Remove zeroing `skb->dev` from `ss_skb_init_for_xmit`. We already zero `skb->dev` at the beginning of processing skb and we don't need to do it at the end, because we don't use it.
Add extra sanity checks: Warn in `cli_mem_release` if client memory is not zero at release time. Warn in `ss_skb_dflt_destructor` if skb memory counter is not fully decremented. These checks help detect memory accounting leaks earlier.
- Add comments for new implemented BUG_ONs - Remove BUG_ON from `tfw_h2_stream_send_postponed`. There is a possible case when conn->write_queue is not empty. - Remove http2 `ctx` from tfw_h2_entail_stream_skb` arguments.
- Implement range for this option from 1K (such small value for test purposes) to 100G. - Use common new implemented `tfw_cfg_set_mem_val` function to parse and check this option.
7df7a34 to
2a35da6
Compare
| @@ -91,6 +91,12 @@ extern TEST_SUITE_MPART_ARR(http2_parser, H2_SUITE_PART_CNT); | |||
| extern int tfw_pool_init(void); | |||
| extern void tfw_pool_exit(void); | |||
There was a problem hiding this comment.
This is a new pull request, so please:
- name the branches according to our guides
- provide some meaningful description in the title of the PR and it's description
This PR is about #1715. It does not "fixes" #1346. It is from you, not Jinhua.
Maybe we need the branch name, but the title could must be more meaningful
| struct work_struct kill_work; | ||
| long __percpu *mem; | ||
| struct list_head in_free_list; | ||
| struct tfw_client_mem_t *next_free; |
There was a problem hiding this comment.
I didn't get your comment:
We can't do it! Look we allocate and initialize ALL other members only once during tfw_cli_mem_pool_init! In tfw_cli_mem_pool_alloc we only get TfwCLientMem from free_list! So all this fields should be separate!
While a TfwClientMem block is in free list, then only next_free pointer is used - we do not need the rest of the data structure. Once a block is allocated, we do not need next_free and can initialize it and reuse the memory. Initialization is just 8 byte write and the bytes are already in the L1 cache - we can initialize the part of the structure on each allocation.
Also usually list members go first to prefetch the data structure on the list dereference.
- Add comments to TfwClientMem structure - Combine `next_free` member with `struct work`.
eefb3d4 to
b74e8dc
Compare
No description provided.