the second parameter of function rte_mempool_create mustn't be 2^q - 1
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Juniper Openstack | Status tracked in Trunk | |||||
R5.0 |
In Progress
|
Undecided
|
Yi-y-yang | |||
Trunk |
Fix Committed
|
High
|
Yi-y-yang | |||
OpenContrail |
New
|
Undecided
|
Unassigned |
Bug Description
in DPDK header file lib/librte_
The optimum size (in terms of memory usage) for a mempool is when n is a power of two minus one: n = (2^q - 1).
But actually it isn't true, in the rest of this function, it says again:
It is advised to choose cache_size to have "n modulo cache_size == 0", if this is not the case, some elements will always stay in the pool and will never be used.
Obviously, these statement is self-contradictory. If n is (2^q -1), it is impossible to have "n modulo cache_size == 0".
Per our experiment, "n modulo cache_size == 0" is better than "n = (2^q -1)". In all the rte_mempool_create calls in DPDK source code, we don't find any case which used 2^q - 1 for the second parameter. So we're inclined to use "n modulo cache_size == 0".
Review in progress for https:/ /review. opencontrail. org/45523
Submitter: Yi Yang (<email address hidden>)