From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Alejandro Lucero <alejandro.lucero@netronome.com>
Cc: dev <dev@dpdk.org>, Thomas Monjalon <thomas@monjalon.net>,
srinath.mannam@broadcom.com, scott.branden@broadcom.com,
Ajit Khaparde <ajit.khaparde@broadcom.com>
Subject: Re: [dpdk-dev] [RFC 03/11] malloc: index heaps using heap ID rather than NUMA node
Date: Fri, 13 Jul 2018 17:08:28 +0100 [thread overview]
Message-ID: <7e5fa73f-7006-44d5-3e31-40cb7a948f9c@intel.com> (raw)
In-Reply-To: <CAD+H993L5HRt8q4mtDUZksFyWX0WPqT-rOPvvpPWc_6kmt5NoQ@mail.gmail.com>
On 13-Jul-18 5:05 PM, Alejandro Lucero wrote:
>> - /* get pointer to global configuration */
>> - mcfg = rte_eal_get_configuration()->mem_config;
>> -
>> - for (i = 0; i < RTE_MAX_NUMA_NODES; i++) {
>> - if ((socket != SOCKET_ID_ANY) && (socket != i))
>> + for (idx = 0; idx < rte_socket_count(); idx++) {
>> + int cur_socket = rte_socket_id_by_idx(idx);
>> + if ((socket != SOCKET_ID_ANY) && (socket != cur_socket))
>> continue;
>>
>> - malloc_heap_get_stats(&mcfg->malloc_heaps[i], &stats);
>> - if (stats.greatest_free_size > len) {
>> - len = stats.greatest_free_size;
>> - *s = i;
>> + size_t cur_len = heap_max_free_elem(idx, align);
>> + if (cur_len > len) {
>> + len = cur_len;
>> + *s = cur_socket;
>> }
>> }
>>
>> - if (len < MALLOC_ELEM_OVERHEAD + align)
>> - return 0;
>> -
>> - return len - MALLOC_ELEM_OVERHEAD - align;
>> + return len;
>>
>
> Is it worth to set *s to some safe value if no space at all?
No, the value of *s is set externally anyway, and is not used of return
value is 0.
Thanks for other comments, will fix when the next iteration comes.
--
Thanks,
Anatoly
next prev parent reply other threads:[~2018-07-13 16:08 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-06 13:17 [dpdk-dev] [RFC 00/11] Support externally allocated memory in DPDK Anatoly Burakov
2018-07-06 13:17 ` [dpdk-dev] [RFC 01/11] mem: allow memseg lists to be marked as external Anatoly Burakov
2018-07-10 11:18 ` Alejandro Lucero
2018-07-10 11:31 ` Burakov, Anatoly
2018-07-06 13:17 ` [dpdk-dev] [RFC 02/11] eal: add function to rerieve socket index by socket ID Anatoly Burakov
2018-07-10 13:03 ` Alejandro Lucero
2018-07-06 13:17 ` [dpdk-dev] [RFC 03/11] malloc: index heaps using heap ID rather than NUMA node Anatoly Burakov
2018-07-13 16:05 ` Alejandro Lucero
2018-07-13 16:08 ` Burakov, Anatoly [this message]
2018-07-06 13:17 ` [dpdk-dev] [RFC 04/11] malloc: add name to malloc heaps Anatoly Burakov
2018-07-13 16:09 ` Alejandro Lucero
2018-07-06 13:17 ` [dpdk-dev] [RFC 05/11] malloc: enable retrieving statistics from named heaps Anatoly Burakov
2018-07-13 16:25 ` Alejandro Lucero
2018-07-06 13:17 ` [dpdk-dev] [RFC 06/11] malloc: enable allocating " Anatoly Burakov
2018-07-13 16:31 ` Alejandro Lucero
2018-07-06 13:17 ` [dpdk-dev] [RFC 07/11] malloc: enable creating new malloc heaps Anatoly Burakov
2018-07-06 13:17 ` [dpdk-dev] [RFC 08/11] malloc: allow adding memory to named heaps Anatoly Burakov
2018-07-13 17:04 ` Alejandro Lucero
2018-07-06 13:17 ` [dpdk-dev] [RFC 09/11] malloc: allow removing memory from " Anatoly Burakov
2018-07-06 13:17 ` [dpdk-dev] [RFC 10/11] malloc: allow destroying heaps Anatoly Burakov
2018-07-06 13:17 ` [dpdk-dev] [RFC 11/11] memzone: enable reserving memory from named heaps Anatoly Burakov
2018-07-13 17:10 ` [dpdk-dev] [RFC 00/11] Support externally allocated memory in DPDK Burakov, Anatoly
2018-07-13 17:56 ` Wiles, Keith
2018-07-19 10:58 ` László Vadkerti
2018-07-26 13:48 ` Burakov, Anatoly
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=7e5fa73f-7006-44d5-3e31-40cb7a948f9c@intel.com \
--to=anatoly.burakov@intel.com \
--cc=ajit.khaparde@broadcom.com \
--cc=alejandro.lucero@netronome.com \
--cc=dev@dpdk.org \
--cc=scott.branden@broadcom.com \
--cc=srinath.mannam@broadcom.com \
--cc=thomas@monjalon.net \
/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).