[dpdk-dev] [PATCH RFC] eal: change default per socket memory allocation

Burakov, Anatoly anatoly.burakov at intel.com
Thu May 1 18:06:57 CEST 2014


Hi David, Didier,

> +		/* Set memory amount per socket; round up to be sure that
> sum of all */
> +		/* sockets allocation is greater than requested memory size
> */
> +		for (socket_id=0 ; socket_id<RTE_MAX_NUMA_NODES ;
> socket_id++) {
> +			internal_config.socket_mem[socket_id] =
> (internal_config.memory *
> +			    cpu_per_socket[socket_id] + rte_lcore_count() - 1)
> /
> +			    rte_lcore_count();
> +		}
> +	}
> +

Can I suggest to do an RTE_MAX between (internal_config.memory - total_mem) and (internal_config.memory * cpu_per_socket[socket_id] + rte_lcore_count() - 1) / rte_lcore_count() ? I don't think it's a good idea to go over the requested amount. Let the last core have a chance of reserving slightly less memory than other cores, but don't let it go over the limit. If specific memory constraints are required, let the user use --socket-mem instead.

Also, nitpicking, but multiline commends should go under a single /* ... */ in order to keep consistency with other DPDK code.

Best regards,
Anatoly Burakov
DPDK SW Engineer

--------------------------------------------------------------
Intel Shannon Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263
Business address: Dromore House, East Park, Shannon, Co. Clare





More information about the dev mailing list