]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mm/rmap: use page_not_mapped in try_to_unmap()
authorMiaohe Lin <linmiaohe@huawei.com>
Fri, 26 Feb 2021 01:18:03 +0000 (17:18 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 11 Jul 2021 10:49:27 +0000 (12:49 +0200)
commit420afb489a1f6981cbe2fb9ee10007dba878e223
tree90c9066afc25ffe57dc72e47b0f06de738f69bef
parent784445344c9e7cdef2a2a724fab34243933a91dc
mm/rmap: use page_not_mapped in try_to_unmap()

[ Upstream commit b7e188ec98b1644ff70a6d3624ea16aadc39f5e0 ]

page_mapcount_is_zero() calculates accurately how many mappings a hugepage
has in order to check against 0 only.  This is a waste of cpu time.  We
can do this via page_not_mapped() to save some possible atomic_read
cycles.  Remove the function page_mapcount_is_zero() as it's not used
anymore and move page_not_mapped() above try_to_unmap() to avoid
identifier undeclared compilation error.

Link: https://lkml.kernel.org/r/20210130084904.35307-1-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
mm/rmap.c