You still need to mark the pte dirty. Becuase you know that it _is_ dirty,
or it wouldn't have had a swap cache entry allocated to it.
Or you need to not drop the swap cache.
Failing to mark it dirty will cause all kind sof interesting problems when
pages suddenly become zero-filled when the VM scanning just drops the old
contents (which sure makes for good performance, but not for nice
behaviour ;)
So I would suggest:
if (exclusive_swap_page(page)) {
if (vma->vm_flags & VM_WRITE)
pte = pte_mkwrite(pte);
pte = pte_mkdirty(pte);
delete_from_swap_cache_nolock(page);
}
or similar.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/