mm: why vfree() do not free page table memory?
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
Quoted 9 lines · Xishi Qiu
When calling
vfree(), it callsunmap_vmap_area()to clear page table, but do not free the memory of page table, why? just for performance?If a driver use
vmalloc()andvfree()frequently, we will lost much page table memory, maybe oom later.Thanks,
Xishi Qiu
ping
Quoted 3 lines
.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 2 lines · Xishi Qiu
When calling
vfree(), it callsunmap_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.
Quoted 2 lines
If a driver use
vmalloc()andvfree()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.
Quoted 3 lines
Thanks,
Xishi Qiu
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 7 lines · Vlastimil Babka
Quoted 2 lines · Xishi Qiu
When calling
vfree(), it callsunmap_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?
Quoted 7 lines
Quoted 2 lines
If a driver use
vmalloc()andvfree()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.
Thanks,
Xishi Qiu
Quoted 7 lines
Quoted 3 lines
Thanks,
Xishi Qiu.
Quoted 6 lines · Xishi Qiu
Quoted 4 lines · Vlastimil Babka
Quoted 2 lines · Xishi Qiu
When calling
vfree(), it callsunmap_vmap_area()to clear page table, but do not free the memory of page table, why? just for performance?
Quoted 8 lines
Quoted 3 lines
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_STARTtoVMALLOC_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.
Quoted 10 lines
Quoted 7 lines
Quoted 2 lines
If a driver use
vmalloc()andvfree()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
Quoted 13 lines
Thanks,
Xishi QiuQuoted 7 lines
Quoted 3 lines
Thanks,
Xishi Qiu.
Quoted 4 lines · Xishi Qiu
Quoted 1 line
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 must be quite the module you're loading there ...
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>