• David Hildenbrand's avatar
    mm/ksm: convert get_mergeable_page() from follow_page() to folio_walk · 184e916c
    David Hildenbrand authored
    Let's use folio_walk instead, for example avoiding taking temporary folio
    references if the folio does not even apply and getting rid of one more
    follow_page() user.
    
    Note that zeropages obviously don't apply: old code could just have
    specified FOLL_DUMP.  Anon folios are never secretmem, so we don't care
    about losing the check in follow_page().
    
    Link: https://lkml.kernel.org/r/20240802155524.517137-6-david@redhat.comSigned-off-by: default avatarDavid Hildenbrand <david@redhat.com>
    Cc: Alexander Gordeev <agordeev@linux.ibm.com>
    Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
    Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
    Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
    Cc: Heiko Carstens <hca@linux.ibm.com>
    Cc: Janosch Frank <frankja@linux.ibm.com>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Sven Schnelle <svens@linux.ibm.com>
    Cc: Vasily Gorbik <gor@linux.ibm.com>
    Cc: Ryan Roberts <ryan.roberts@arm.com>
    Cc: Zi Yan <ziy@nvidia.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    184e916c
ksm.c 105 KB