mm/filemap: Add folio_unlock()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 7 Dec 2020 20:44:35 +0000 (15:44 -0500)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 27 Sep 2021 13:27:30 +0000 (09:27 -0400)
commit4e1364286d0a2dd384bceb6db6185b99c0e2c0bc
tree57e1d10680fc3900a884c40f94dcb308bf5d5123
parent2f52578f9c64d7d9a96ab81c243cc20804fabf2b
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>
include/linux/pagemap.h
mm/filemap.c
mm/folio-compat.c