diff options
author | Hugh Dickins <hugh@veritas.com> | 2005-09-03 15:54:39 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 00:05:41 -0700 |
commit | 52b7efdbe5f5696fc80338560a3fc51e0b0a993c (patch) | |
tree | 30162de9fc8fe3dddb6462f8ff82f1594067cadd /lib/bust_spinlocks.c | |
parent | 7dfad4183bf9cd92f977caa3c12cc74f0eefc0e6 (diff) | |
download | linux-52b7efdbe5f5696fc80338560a3fc51e0b0a993c.tar.bz2 |
[PATCH] swap: scan_swap_map drop swap_device_lock
get_swap_page has often shown up on latency traces, doing lengthy scans while
holding two spinlocks. swap_list_lock is already dropped, now scan_swap_map
drop swap_device_lock before scanning the swap_map.
While scanning for an empty cluster, don't worry that racing tasks may
allocate what was free and free what was allocated; but when allocating an
entry, check it's still free after retaking the lock. Avoid dropping the lock
in the expected common path. No barriers beyond the locks, just let the
cookie crumble; highest_bit limit is volatile, but benign.
Guard against swapoff: must check SWP_WRITEOK before allocating, must raise
SWP_SCANNING reference count while in scan_swap_map, swapoff wait for that to
fall - just use schedule_timeout, we don't want to burden scan_swap_map
itself, and it's very unlikely that anyone can really still be in
scan_swap_map once swapoff gets this far.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'lib/bust_spinlocks.c')
0 files changed, 0 insertions, 0 deletions