On 12/17/2013 10:23 PM, Wanpeng Li wrote:
- mlock_vma_page(page); /* no-op if already mlocked */ - if (page == check_page) + if (page != check_page && trylock_page(page)) { + mlock_vma_page(page); /* no-op if already mlocked */ + unlock_page(page); + } else if (page == check_page) { + mlock_vma_page(page); /* no-op if already mlocked */ ret = SWAP_MLOCK; + }
Previously, if page != check_page and the page was locked, we'd call mlock_vma_page() anyways. With this change, we don't. In fact, we'll just skip that entire block not doing anything. If that's something that's never supposed to happen, can we add a VM_BUG_ON(page != check_page && PageLocked(page)) Just to cover this new code path? Thanks, Sasha -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>