Messages in this thread | | | Date | Wed, 30 Jan 2013 16:31:23 -0800 | Subject | Re: mmap() scalability in the presence of the MAP_POPULATE flag | From | Michel Lespinasse <> |
| |
Hi Roman,
On Fri, Jan 4, 2013 at 11:43 PM, Michel Lespinasse <walken@google.com> wrote: > On Fri, Jan 4, 2013 at 10:40 PM, Roman Dubtsov <dubtsov@gmail.com> wrote: >> - POPULATE_VIA_LOOP -- makes the test populate memory using a loop >> - POPULATE_VIA_MMAP -- makes the test populate memory via MAP_POPULATE >> > Heh, very interesting. As it turns out, the problem gets MUCH worse as > the number of threads increase. > > In the POPULATE_VIA_MMAP, follow_page() is called at 4KB increment > addresses, and it takes the mm->page_table_lock 511 times out of 512 > (that is, every time it falls within a huge page that's just been > populated). So all OMP_NUM_THREADS threads are constantly bouncing > over the mm->page_table_lock, and getting terrible performance as a > result.
FYI, the patchset I just sent out ("fixes for large mm_populate() and munlock() operations") takes care of this and brings POPULATE_VIA_MMAP performance up where it should be.
Thanks a lot for the report, as I hadn't noticed this issue before :)
-- Michel "Walken" Lespinasse A program is never fully debugged until the last user dies.
| |