> -----Original Message-----
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of Maxim
> Uvarov
> Sent: Monday, December 12, 2016 6:45 PM
> To: lng-odp-forward <lng-odp@lists.linaro.org>
> Subject: [lng-odp] sizeof(pool_table_t) = 272M
> 
> The latest pool changed set huge pool_table_t. That is due to:
> 
> #define CONFIG_POOL_MAX_NUM (1 * 1024 * 1024)
> 
> If for example it's
> #define CONFIG_POOL_MAX_NUM (4096)
> 
> Then pool_table_t is 18M.
> 
> 
> Allocation happens here:
> int odp_pool_init_global(void)
> {
> 
>       shm = odp_shm_reserve("_odp_pool_table",
>                             sizeof(pool_table_t),
>                             ODP_CACHE_LINE_SIZE, 0);
> 
> ...
> 
> 
> Because of with latest changes in api-next for process mode and drivers
> mapping file in /tmp/ directory is created. So for each process there is
> 272M file. I think that is too big and can be a problem with testing on
> small machines.
> 
> 1. Can we lower that number of maximum entries in the pool?


This is why those are config options. We can trade-off capability to memory 
usage. Both of these affect to the memory usage:

/*
 * Maximum number of pools
 */
#define ODP_CONFIG_POOLS 64

/*
 * Maximum number of events in a pool
 */
#define CONFIG_POOL_MAX_NUM (1 * 1024 * 1024)


If you cut both in half, the memory usage drops into one fourth...


> 
> 2. Can we remove that table from here completely and made it dynamic in
> odp_pool_create()?


Not really, it would be unnecessary complicated compared to the gain. For 
example, I have 8GB memory on my laptop, 128 GB on my server and even raspberry 
pi has 1 GB. Laptop would run one/two instances, server a few (up to 6), 
raspberry only one. 

The current memory consumption would be problem only for a raspberry user, but 
it would be very easy for him/her to scale down this (and other) config options 
to match the system resources. Default ODP configuration is targeted for higher 
end than single core, single interface, single GB memory systems.


Anyway, I think at least ODP_CONFIG_POOLS could be decreased, may be even 
halved. Typically, our tests use only one or few pools. Also max event count 
could be decreased, but it should be a power of two. It could be also halved, 
as most of our tests create only 8k num packets per pool.


-Petri

Reply via email to