]> git.baikalelectronics.ru Git - kernel.git/commit
mm: remove incorrect swap_count() from try_to_unuse()
authorBo Liu <bo-liu@hotmail.com>
Mon, 2 Nov 2009 16:50:33 +0000 (16:50 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 2 Nov 2009 17:44:41 +0000 (09:44 -0800)
commitfd903b6b566d4710ea472cb8c4ee1350a22088c0
tree7a392ac3196770c49622d5d5cb41f77c46a35f83
parent0b8c4478828c4e364db97a22c2cdc702f5fcb85f
mm: remove incorrect swap_count() from try_to_unuse()

In try_to_unuse(), swcount is a local copy of *swap_map, including the
SWAP_HAS_CACHE bit; but a wrong comparison against swap_count(*swap_map),
which masks off the SWAP_HAS_CACHE bit, succeeded where it should fail.

That had the effect of resetting the mm from which to start searching
for the next swap page, to an irrelevant mm instead of to an mm in which
this swap page had been found: which may increase search time by ~20%.
But we're used to swapoff being slow, so never noticed the slowdown.

Remove that one spurious use of swap_count(): Bo Liu thought it merely
redundant, Hugh rewrote the description since it was measurably wrong.

Signed-off-by: Bo Liu <bo-liu@hotmail.com>
Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/swapfile.c