diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2022-02-12 17:43:16 -0500 |
---|---|---|
committer | Matthew Wilcox (Oracle) <willy@infradead.org> | 2022-03-21 12:59:01 -0400 |
commit | e41c81d0d30e1a6ebf408feaf561f80cac4457dc (patch) | |
tree | 4337c6160315b516d9c58241832a235f6656a93f /mm/migrate.c | |
parent | 4418481396b2caeded6d0eed11ac9052ab4c0763 (diff) | |
download | linux-e41c81d0d30e1a6ebf408feaf561f80cac4457dc.tar.bz2 |
mm/truncate: Replace page_mapped() call in invalidate_inode_page()
folio_mapped() is expensive because it has to check each page's mapcount
field. A cheaper check is whether there are any extra references to
the page, other than the one we own, one from the page private data and
the ones held by the page cache.
The call to remove_mapping() will fail in any case if it cannot freeze
the refcount, but failing here avoids cycling the i_pages spinlock.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Miaohe Lin <linmiaohe@huawei.com>
Diffstat (limited to 'mm/migrate.c')
0 files changed, 0 insertions, 0 deletions