diff options
author | Miaohe Lin <linmiaohe@huawei.com> | 2021-05-05 03:37:39 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2021-05-05 20:27:24 +0200 |
commit | 3e96b6a2e9ad929a3230a22f4d64a74671a0720b (patch) | |
tree | 855d56c528bc6166cef1dc7eb08997d72db4753a /mm/ksm.c | |
parent | ksm: remove redundant VM_BUG_ON_PAGE() on stable_tree_search() (diff) | |
download | linux-3e96b6a2e9ad929a3230a22f4d64a74671a0720b.tar.xz linux-3e96b6a2e9ad929a3230a22f4d64a74671a0720b.zip |
ksm: use GET_KSM_PAGE_NOLOCK to get ksm page in remove_rmap_item_from_tree()
It's unnecessary to lock the page when get ksm page if we're going to
remove the rmap item as page migration is irrelevant in this case. Use
GET_KSM_PAGE_NOLOCK instead to save some page lock cycles.
Link: https://lkml.kernel.org/r/20210330140228.45635-3-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r-- | mm/ksm.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -778,12 +778,11 @@ static void remove_rmap_item_from_tree(struct rmap_item *rmap_item) struct page *page; stable_node = rmap_item->head; - page = get_ksm_page(stable_node, GET_KSM_PAGE_LOCK); + page = get_ksm_page(stable_node, GET_KSM_PAGE_NOLOCK); if (!page) goto out; hlist_del(&rmap_item->hlist); - unlock_page(page); put_page(page); if (!hlist_empty(&stable_node->hlist)) |