diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2020-12-07 15:44:35 -0500 |
---|---|---|
committer | Matthew Wilcox (Oracle) <willy@infradead.org> | 2021-09-27 09:27:30 -0400 |
commit | 4e1364286d0a2dd384bceb6db6185b99c0e2c0bc (patch) | |
tree | 57e1d10680fc3900a884c40f94dcb308bf5d5123 /mm/folio-compat.c | |
parent | 2f52578f9c64d7d9a96ab81c243cc20804fabf2b (diff) | |
download | linux-stable-4e1364286d0a2dd384bceb6db6185b99c0e2c0bc.tar.gz linux-stable-4e1364286d0a2dd384bceb6db6185b99c0e2c0bc.tar.bz2 linux-stable-4e1364286d0a2dd384bceb6db6185b99c0e2c0bc.zip |
mm/filemap: Add folio_unlock()
Convert unlock_page() to call folio_unlock(). By using a folio we
avoid a call to compound_head(). This shortens the function from 39
bytes to 25 and removes 4 instructions on x86-64. Because we still
have unlock_page(), it's a net increase of 16 bytes of text for the
kernel as a whole, but any path that uses folio_unlock() will execute
4 fewer instructions.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Jeff Layton <jlayton@kernel.org>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reviewed-by: William Kucharski <william.kucharski@oracle.com>
Reviewed-by: David Howells <dhowells@redhat.com>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'mm/folio-compat.c')
-rw-r--r-- | mm/folio-compat.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/folio-compat.c b/mm/folio-compat.c index 5e107aa30a62..91b3d00a92f7 100644 --- a/mm/folio-compat.c +++ b/mm/folio-compat.c @@ -11,3 +11,9 @@ struct address_space *page_mapping(struct page *page) return folio_mapping(page_folio(page)); } EXPORT_SYMBOL(page_mapping); + +void unlock_page(struct page *page) +{ + return folio_unlock(page_folio(page)); +} +EXPORT_SYMBOL(unlock_page); |