Re: [RFC] mm: why vfree() do not free page table memory?

2018-01-17 Thread Matthew Wilcox
On Wed, Jan 17, 2018 at 05:48:57PM +0800, Xishi Qiu wrote: > > 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. 200MB? That's mapping 800GB of virtual address space. That mus

Re: [RFC] mm: why vfree() do not free page table memory?

2018-01-17 Thread Vlastimil Babka
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

Re: [RFC] mm: why vfree() do not free page table memory?

2018-01-17 Thread Xishi Qiu
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 associat

Re: [RFC] mm: why vfree() do not free page table memory?

2018-01-17 Thread Vlastimil Babka
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. > If a dri

Re: [RFC] mm: why vfree() do not free page table memory?

2018-01-10 Thread Xishi Qiu
On 2017/12/29 16:58, 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? > > If a driver use vmalloc() and vfree() frequently, we will lost much > page table memory, maybe oom later. > > T

[RFC] mm: why vfree() do not free page table memory?

2017-12-29 Thread Xishi Qiu
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? If a driver use vmalloc() and vfree() frequently, we will lost much page table memory, maybe oom later. Thanks, Xishi Qiu