• Matthew Wilcox (Oracle)'s avatar
    mm/util: Add folio_mapping() and folio_file_mapping() · 2f52578f
    Matthew Wilcox (Oracle) authored
    These are the folio equivalent of page_mapping() and page_file_mapping().
    Add an out-of-line page_mapping() wrapper around folio_mapping()
    in order to prevent the page_folio() call from bloating every caller
    of page_mapping().  Adjust page_file_mapping() and page_mapping_file()
    to use folios internally.  Rename __page_file_mapping() to
    swapcache_mapping() and change it to take a folio.
    
    This ends up saving 122 bytes of text overall.  folio_mapping() is
    45 bytes shorter than page_mapping() was, but the new page_mapping()
    wrapper is 30 bytes.  The major reduction is a few bytes less in dozens
    of nfs functions (which call page_file_mapping()).  Most of these appear
    to be a slight change in gcc's register allocation decisions, which allow:
    
       48 8b 56 08         mov    0x8(%rsi),%rdx
       48 8d 42 ff         lea    -0x1(%rdx),%rax
       83 e2 01            and    $0x1,%edx
       48 0f 44 c6         cmove  %rsi,%rax
    
    to become:
    
       48 8b 46 08         mov    0x8(%...
    2f52578f
Makefile 4.73 KB