DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: David Marchand <david.marchand@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH RFC] eal: change default per socket memory	allocation
Date: Thu, 1 May 2014 16:06:57 +0000	[thread overview]
Message-ID: <C6ECDF3AB251BE4894318F4E45123697592AAF93@IRSMSX101.ger.corp.intel.com> (raw)
In-Reply-To: <1398867304-21171-1-git-send-email-david.marchand@6wind.com>

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




  reply	other threads:[~2014-05-01 16:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-30 14:15 David Marchand
2014-05-01 16:06 ` Burakov, Anatoly [this message]
2014-05-02  8:54   ` Burakov, Anatoly
2014-05-02  9:05     ` Venkatesan, Venky
2014-05-05  9:26       ` David Marchand
2014-05-06 10:05         ` Burakov, Anatoly
2014-05-06 15:18           ` Thomas Monjalon
2014-05-06 15:56             ` Burakov, Anatoly
2014-05-07 14:56         ` Venkatesan, Venky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C6ECDF3AB251BE4894318F4E45123697592AAF93@IRSMSX101.ger.corp.intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=david.marchand@6wind.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).