Re: mmap performance and memory use

2011-10-31 Thread Svatopluk Kraus
On Fri, Oct 28, 2011 at 7:38 AM, Alan Cox wrote: > On 10/26/2011 06:23, Svatopluk Kraus wrote: >> >> Hi, >> >> well, I'm working on new port (arm11 mpcore) and pmap_enter_object() >> is what I'm debugging rigth now. And I did not find any way in >> userland how to force kernel to call pmap_enter_o

Re: mmap performance and memory use

2011-10-28 Thread Alan Cox
On 10/26/2011 06:23, Svatopluk Kraus wrote: Hi, well, I'm working on new port (arm11 mpcore) and pmap_enter_object() is what I'm debugging rigth now. And I did not find any way in userland how to force kernel to call pmap_enter_object() which makes SUPERPAGE mapping without promotion. I tried to

Re: mmap performance and memory use

2011-10-26 Thread Svatopluk Kraus
Hi, well, I'm working on new port (arm11 mpcore) and pmap_enter_object() is what I'm debugging rigth now. And I did not find any way in userland how to force kernel to call pmap_enter_object() which makes SUPERPAGE mapping without promotion. I tried to call mmap() with MAP_PREFAULT_READ without su

Re: mmap performance and memory use

2011-10-25 Thread Alan Cox
On 10/10/2011 4:28 PM, Wojciech Puchar wrote: Notice that vm.pmap.pde.promotions increased by 31. This means that 31 superpage mappings were created by promotion from small page mappings. thank you. i looked at .mappings as it seemed logical for me that is shows total. In contrast, vm.pm

Re: mmap performance and memory use

2011-10-12 Thread Alan Cox
On 10/11/2011 12:36, Mark Tinguely wrote: On 10/11/2011 11:12 AM, Alan Cox wrote: On 10/10/2011 16:28, Wojciech Puchar wrote: is it possible to force VM subsystem to operate on superpages when possible - i mean swapping in 2MB chunks? Currently, no. For some applications, like the Sun/Orac

Re: mmap performance and memory use

2011-10-11 Thread Mark Tinguely
On 10/11/2011 11:12 AM, Alan Cox wrote: On 10/10/2011 16:28, Wojciech Puchar wrote: is it possible to force VM subsystem to operate on superpages when possible - i mean swapping in 2MB chunks? Currently, no. For some applications, like the Sun/Oracle JVM, that have code to explicitly manag

Re: mmap performance and memory use

2011-10-11 Thread Alan Cox
On 10/10/2011 16:28, Wojciech Puchar wrote: Notice that vm.pmap.pde.promotions increased by 31. This means that 31 superpage mappings were created by promotion from small page mappings. thank you. i looked at .mappings as it seemed logical for me that is shows total. In contrast, vm.pmap

Re: mmap performance and memory use

2011-10-11 Thread Ivan Voras
On 07/10/2011 19:13, Alan Cox wrote: > On Thu, Oct 6, 2011 at 11:01 AM, Kostik Belousov wrote: >> For one thing, this indeed causes more memory use for the OS. This is >> somewhat mitigated by automatic use of superpages. Superpage promotion >> still keeps the 4KB page table around, so most saving

Re: mmap performance and memory use

2011-10-10 Thread Wojciech Puchar
Notice that vm.pmap.pde.promotions increased by 31. This means that 31 superpage mappings were created by promotion from small page mappings. thank you. i looked at .mappings as it seemed logical for me that is shows total. In contrast, vm.pmap.pde.mappings counts superpage mappings that a

Re: mmap performance and memory use

2011-10-10 Thread Alan Cox
On 10/07/2011 12:23, Wojciech Puchar wrote: You are correct about the page table page. However, a superpage mapping consumes a single PV entry, in place of 512 or 1024 PV entries. This winds up saving about three physical pages worth of memory for every superpage mapping. does it actually w

Re: mmap performance and memory use

2011-10-07 Thread Alan Cox
On Thu, Oct 6, 2011 at 11:01 AM, Kostik Belousov wrote: > On Thu, Oct 06, 2011 at 04:41:45PM +0200, Wojciech Puchar wrote: > > i have few questions. > > > > 1) suppose i map 1TB of address space as anonymous and touch just one > > page. how much memory is used to manage this? > I am not sure how d

Re: mmap performance and memory use

2011-10-07 Thread Wojciech Puchar
You are correct about the page table page.  However, a superpage mapping consumes a single PV entry, in place of 512 or 1024 PV entries.  This winds up saving about three physical pages worth of memory for every superpage mapping. does it actually work? simple test before (only idle system w

Re: mmap performance and memory use

2011-10-06 Thread Wojciech Puchar
page. how much memory is used to manage this? I am not sure how deep the enumeration you want to know, but the first approximation will be: one struct vm_map_entry one struct vm_object one pv_entry actually i don't need precise answer but algorithms. Page table structures need four pages for

Re: mmap performance and memory use

2011-10-06 Thread Kostik Belousov
On Thu, Oct 06, 2011 at 04:41:45PM +0200, Wojciech Puchar wrote: > i have few questions. > > 1) suppose i map 1TB of address space as anonymous and touch just one > page. how much memory is used to manage this? I am not sure how deep the enumeration you want to know, but the first approximation w

mmap performance and memory use

2011-10-06 Thread Wojciech Puchar
i have few questions. 1) suppose i map 1TB of address space as anonymous and touch just one page. how much memory is used to manage this? 2) suppose we have 1TB file on disk without holes and 10 processes mmaps this file to it's address space. are just pages shared or can pagetables be s