Bug 581459 - vmalloc is slow
Summary: vmalloc is slow
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 14
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Rik van Riel
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 582522
Blocks: 583026 619331
TreeView+ depends on / blocked
 
Reported: 2010-04-12 10:28 UTC by Steve Whitehouse
Modified: 2010-11-18 15:41 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 583026 (view as bug list)
Environment:
Last Closed: 2010-11-18 15:41:15 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Test module used to measure vmalloc speed (804 bytes, text/x-csrc)
2010-04-12 10:31 UTC, Steve Whitehouse
no flags Details
Test patch to help track down vmalloc issue (429 bytes, patch)
2010-04-12 10:33 UTC, Steve Whitehouse
no flags Details | Diff

Description Steve Whitehouse 2010-04-12 10:28:50 UTC
Measurements of the speed of vmalloc show that it appears to be slower than it ought to be by about 10x based on a set of measurements on recent kernels. See below for details of the test and results.

Comment 1 Steve Whitehouse 2010-04-12 10:31:37 UTC
Created attachment 405928 [details]
Test module used to measure vmalloc speed

This test module does one million loops of vmalloc two pages, touch memory, vfree and then prints out the time taken. The results from a recent upstream kernel (2.6.34-rc2) look like this:

vmalloc took 148798983 us
vmalloc took 151664529 us
vmalloc took 152416398 us
vmalloc took 151837733 us

Comment 2 Steve Whitehouse 2010-04-12 10:33:14 UTC
Created attachment 405929 [details]
Test patch to help track down vmalloc issue

With the attached patch applied, the new results from the test module look like this:

vmalloc took 15363634 us
vmalloc took 15358026 us
vmalloc took 15240955 us
vmalloc took 15402302 us


thats a 10x speed up...

Comment 4 Steve Whitehouse 2010-04-12 10:37:59 UTC
It looks like the issue is that the lazy TLB code is causing lots of old vmalloc'ed areas to stay around, making new allocations slow. I wonder if its possible to make the caching of older areas less aggressive without reducing the beneficial effects of fewer TLB flushes?

Comment 6 Chuck Ebbert 2010-07-18 18:53:56 UTC
There is a patch in -mm that seems to fix this, but it doesn't seem to be going anywhere:

http://userweb.kernel.org/~akpm/mmotm/broken-out/mm-vmap-area-cache.patch

Comment 8 Bug Zapper 2010-07-30 11:18:27 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle.
Changing version to '14'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 9 Steve Whitehouse 2010-11-18 15:41:15 UTC
Might as well close this since the upstream resolution is that we shouldn't be using vmalloc for any allocation where performance matters.


Note You need to log in before you can comment on or make changes to this bug.