diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-12-19 20:11:12 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-09 20:25:15 (GMT) |
commit | 25c36e26d6a1021276330142f4c495235d6970de (patch) | |
tree | ac3cca692b47e3fce0a7c6bc90638dd528cd7e60 /fs/open.c | |
parent | 1b8f3096911f5e0c3bf7ec8739e181247e1fbc4f (diff) | |
download | linux-fsl-qoriq-25c36e26d6a1021276330142f4c495235d6970de.tar.xz |
aio: clean up and fix aio_setup_ring page mapping
commit 3dc9acb67600393249a795934ccdfc291a200e6b upstream.
Since commit 36bc08cc01709 ("fs/aio: Add support to aio ring pages
migration") the aio ring setup code has used a special per-ring backing
inode for the page allocations, rather than just using random anonymous
pages.
However, rather than remembering the pages as it allocated them, it
would allocate the pages, insert them into the file mapping (dirty, so
that they couldn't be free'd), and then forget about them. And then to
look them up again, it would mmap the mapping, and then use
"get_user_pages()" to get back an array of the pages we just created.
Now, not only is that incredibly inefficient, it also leaked all the
pages if the mmap failed (which could happen due to excessive number of
mappings, for example).
So clean it all up, making it much more straightforward. Also remove
some left-overs of the previous (broken) mm_populate() usage that was
removed in commit d6c355c7dabc ("aio: fix race in ring buffer page
lookup introduced by page migration support") but left the pointless and
now misleading MAP_POPULATE flag around.
Tested-and-acked-by: Benjamin LaHaise <bcrl@kvack.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/open.c')
0 files changed, 0 insertions, 0 deletions