]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Convert shmem_unuse_inode() to use a lockless gang lookup of the radix
authorHugh Dickins <hughd@google.com>
Tue, 26 Jul 2011 10:14:53 +0000 (20:14 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 1 Aug 2011 03:36:37 +0000 (13:36 +1000)
commit7eea8cecca8dccc755c26978b90ddd4c00e9d1fd
tree2b57706b0116e2ae95b2cb595198f2ade47a4206
parent014669322e27df13de16d989ed905d8845cd6148
Convert shmem_unuse_inode() to use a lockless gang lookup of the radix
tree, searching for matching swap.

This is somewhat slower than the old method: because of repeated radix
tree descents, because of copying entries up, but probably most because
the old method noted and skipped once a vector page was cleared of swap.
Perhaps we can devise a use of radix tree tagging to achieve that later.

shmem_add_to_page_cache() uses shmem_radix_tree_replace() to compensate
for the lockless lookup by checking that the expected entry is in place,
under lock.  It is not very satisfactory to be copying this much from
add_to_page_cache_locked(), but I think easier to sell than insisting that
every caller of add_to_page_cache*() go through the extras.

Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/shmem.c