It appears that move_from_swap_cache() is in good company:
1: shmem_unuse_inode() calls delete_from_swap_cache under
spinlock, but delete_from_swap_cache() calls block_flushpage(),
which can sleep.
2: shmem_getpage_locked() calls delete_from_swap_cache() calls
block_flushpage() under info->lock.
3: zap_pte_range holds mm->page_table_lock, and calls
free_swap_and_cache() calls delete_from_swap_cache() calls
block_flushpage() can only sleep in the lock_buffer() in
discard_buffer(). It so happens that all three callers
are always using block_flushpage() against a locked
swapcache page, and (correct me if I'm wrong), it's
not possible for those buffers to be locked.
So we got lucky.
A short-term fix is to put a BIG FAT COMMENT over block_flushpage.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to email@example.com
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/