DPDK patches and discussions
 help / color / mirror / Atom feed
From: gowrishankar muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
To: "Burakov, Anatoly" <anatoly.burakov@intel.com>,
	Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Cc: dev@dpdk.org, Thomas Monjalon <thomas@monjalon.net>,
	stable@dpdk.org, Chao Zhu <chaozhu@linux.vnet.ibm.com>
Subject: Re: [dpdk-dev] [PATCH 1/2] eal/malloc: merge malloc_elems in heap if they are contiguous
Date: Fri, 4 May 2018 16:11:40 +0530	[thread overview]
Message-ID: <78f363f1-79d8-0369-05eb-8f853d9c76a5@linux.vnet.ibm.com> (raw)
In-Reply-To: <68d1bc7b-a90d-2adc-c98b-560276589b15@intel.com>

Hi Anatoly,

On Friday 04 May 2018 02:59 PM, Burakov, Anatoly wrote:
> On 03-May-18 11:11 AM, Gowrishankar wrote:
>> From: Gowrishankar Muthukrishnan <gowrishankar.m@linux.vnet.ibm.com>
>>
>> During malloc heap init, if there are malloc_elems contiguous in
>> virt addresses, they could be merged so that, merged malloc_elem
>> would guarantee larger free memory size than its actual hugepage
>> size, it was created for.
>>
>> Fixes: fafcc11985 ("mem: rework memzone to be allocated by malloc")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Gowrishankar Muthukrishnan 
>> <gowrishankar.m@linux.vnet.ibm.com>
>> ---
>
> Hi Gowrishankar,
>
> I haven't looked at the patchset in detail yet, however i have a 
> general question: how do we end up with VA-contiguous memsegs that are 
> not part of the same memseg in the first place? Is there something 
> wrong with memseg sorting code? Alternatively, if 
> they were broken up, presumably they were broken up for a reason, 
> namely while they may be VA contiguous, they weren't IOVA-contiguous.

In powerpc, when *nr_overcommit_hugepages set* (to respect address hint 
in get_virtual_area() as requested by secondary process), mmap() would 
not be allocate one big VA chunk for all the available hugepages. In 
order to support secondary process be in same VA
range, we need to add anonymous and hugetlb flags in mmap calls while 
remapping. As mmap can only create max VA at the size of hugepage 
(MAP_HUGETLB) and also to respect address hint (MAP_ANONYMOUS), multiple 
VA chunks are created, even though both VA and IOVA are contiguous in 
most of the cases.

>
> Can you provide a dump of physmem layout where memory would have been 
> VA and IOVA-contiguous while belonging to different memsegs?

Please find here: https://pastebin.com/tDNEaxdU

As you notice malloc_heaps, its index for heap size is 8 which is 
supposedly 11.

To note, these are not problems with memory rework done in latest code 
base. So, I refered code until v18.02.

-- 
Regards,
Gowrishankar M

  reply	other threads:[~2018-05-04 10:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-03 10:11 [dpdk-dev] [PATCH 0/2] eal/malloc: fix wrong heap initialization over multiple memsegs Gowrishankar
2018-05-03 10:11 ` [dpdk-dev] [PATCH 1/2] eal/malloc: merge malloc_elems in heap if they are contiguous Gowrishankar
2018-05-04  9:29   ` Burakov, Anatoly
2018-05-04 10:41     ` gowrishankar muthukrishnan [this message]
2018-05-04 11:02       ` Burakov, Anatoly
2018-05-03 10:11 ` [dpdk-dev] [PATCH 2/2] eal/malloc: fix heap index to correctly insert memseg Gowrishankar
2018-05-18 13:10 ` [dpdk-dev] [PATCH 0/2] eal/malloc: fix wrong heap initialization over multiple memsegs Thomas Monjalon
2018-05-19  1:35   ` gowrishankar muthukrishnan

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=78f363f1-79d8-0369-05eb-8f853d9c76a5@linux.vnet.ibm.com \
    --to=gowrishankar.m@linux.vnet.ibm.com \
    --cc=anatoly.burakov@intel.com \
    --cc=chaozhu@linux.vnet.ibm.com \
    --cc=dev@dpdk.org \
    --cc=sergio.gonzalez.monroy@intel.com \
    --cc=stable@dpdk.org \
    --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).