linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Xishi Qiu <qiuxishi@huawei.com>
Cc: Michal Hocko <mhocko@kernel.org>,
	Mel Gorman <mgorman@techsingularity.net>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux MM <linux-mm@kvack.org>,
	"Wujiangtao (A)" <wu.wujiangtao@huawei.com>
Subject: Re: [RFC] mm: why vfree() do not free page table memory?
Date: Wed, 17 Jan 2018 14:14:42 +0100	[thread overview]
Message-ID: <6598f55a-49c6-c5df-974a-e697317ade9b@suse.cz> (raw)
In-Reply-To: <5A5F1C09.9040000@huawei.com>

On 01/17/2018 10:48 AM, Xishi Qiu wrote:
> On 2018/1/17 17:16, Vlastimil Babka wrote:
> 
>> On 12/29/2017 09:58 AM, Xishi Qiu wrote:
>>> When calling vfree(), it calls unmap_vmap_area() to clear page table,
>>> but do not free the memory of page table, why? just for performance?
>>
>> I guess it's expected that the free virtual range and associated page
>> tables it might be reused later.
>>
> 
> Hi Vlastimili 1/4 ?
> 
> If use vmalloc/vfree different size, then there will be some hols during 
> VMALLOC_START to VMALLOC_END, and this holes takes page table memory, right?

Possibly. But to free a page table page, there has to be contiguous
aligned 2MB hole.

>>> If a driver use vmalloc() and vfree() frequently, we will lost much
>>> page table memory, maybe oom later.
>>
>> If it's reused, then not really.
>>
>> Did you notice an actual issue, or is this just theoretical concern.
>>
> 
> Yes, we have this problem on our production line.
> I find the page table memory takes 200-300M.

Well, can you verify that it's really due to vmalloc holes? And that the
holes are there because of an unfortunate sequence of vmalloc/vfree, and
not due to some bug in vmalloc failing to reuse freed areas properly?
And do the holes contain enough 2MB aligned ranges to make it possible
to free the page tables?

Vlastimil

> Thanks,
> Xishi Qiu
> 
>>> Thanks,
>>> Xishi Qiu
>>>
>>
>>
>> .
>>
> 
> 
> 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2018-01-17 13:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-29  8:58 Xishi Qiu
2018-01-11  1:27 ` Xishi Qiu
2018-01-17  9:16 ` Vlastimil Babka
2018-01-17  9:48   ` Xishi Qiu
2018-01-17 13:14     ` Vlastimil Babka [this message]
2018-01-17 14:17     ` Matthew Wilcox

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=6598f55a-49c6-c5df-974a-e697317ade9b@suse.cz \
    --to=vbabka@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@kernel.org \
    --cc=qiuxishi@huawei.com \
    --cc=wu.wujiangtao@huawei.com \
    /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