lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6598f55a-49c6-c5df-974a-e697317ade9b@suse.cz>
Date:   Wed, 17 Jan 2018 14:14:42 +0100
From:   Vlastimil Babka <vbabka@...e.cz>
To:     Xishi Qiu <qiuxishi@...wei.com>
Cc:     Michal Hocko <mhocko@...nel.org>,
        Mel Gorman <mgorman@...hsingularity.net>,
        LKML <linux-kernel@...r.kernel.org>,
        Linux MM <linux-mm@...ck.org>,
        "Wujiangtao (A)" <wu.wujiangtao@...wei.com>
Subject: Re: [RFC] mm: why vfree() do not free page table memory?

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 Vlastimil,
> 
> 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
>>>
>>
>>
>> .
>>
> 
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ