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-next>] [day] [month] [year] [list]
Date:	Tue, 10 Aug 2010 21:50:18 +0200
From:	Micha Nelissen <micha@...i.hopto.org>
To:	linux-kernel@...r.kernel.org
Subject: Why is get_user_pages so slow?

Hi all,

Why is get_user_pages much slower than taking the faults? (I would 
expect it to be faster).

Attached example program first mallocs a piece of memory (64MB in this 
case) then reads it "to take the faults". Afterwards, it uses mmap with 
MAP_POPULATE to "speed up" and not to have to take the faults, but have 
everything mapped in one go. I think mmap is using get_user_pages in 
this case.

$ ./memspeed
malloc took 0 msecs
read took 14 msecs
write took 0 msecs
free took 1 msecs
mmap took 45 msecs
munmap took 5 msecs

Using MAP_POPULATE is 3 times as slow as the 'stupid' implementation! 
I'm running a Core 2 duo e6300 system with linux 2.6.28.4.

Am I doing something wrong? MAP_POPULATE seems a bit of a joke to me.

Thanks,

Micha

View attachment "memspeed.c" of type "text/x-csrc" (1585 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ