• Usama Arif's avatar
    mm: introduce a pageflag for partially mapped folios · 8422acdc
    Usama Arif authored
    Currently folio->_deferred_list is used to keep track of partially_mapped
    folios that are going to be split under memory pressure.  In the next
    patch, all THPs that are faulted in and collapsed by khugepaged are also
    going to be tracked using _deferred_list.
    
    This patch introduces a pageflag to be able to distinguish between
    partially mapped folios and others in the deferred_list at split time in
    deferred_split_scan.  Its needed as __folio_remove_rmap decrements
    _mapcount, _large_mapcount and _entire_mapcount, hence it won't be
    possible to distinguish between partially mapped folios and others in
    deferred_split_scan.
    
    Eventhough it introduces an extra flag to track if the folio is partially
    mapped, there is no functional change intended with this patch and the
    flag is not useful in this patch itself, it will become useful in the next
    patch when _deferred_list has non partially mapped folios.
    
    Link: https://lkml.kernel.org/r/20240830100438.3623486-5-usamaarif642@gmail.comSigned-off-by: default avatarUsama Arif <usamaarif642@gmail.com>
    Cc: Alexander Zhu <alexlzhu@fb.com>
    Cc: Barry Song <baohua@kernel.org>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: Domenico Cerasuolo <cerasuolodomenico@gmail.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Kairui Song <ryncsn@gmail.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Mike Rapoport <rppt@kernel.org>
    Cc: Nico Pache <npache@redhat.com>
    Cc: Rik van Riel <riel@surriel.com>
    Cc: Roman Gushchin <roman.gushchin@linux.dev>
    Cc: Ryan Roberts <ryan.roberts@arm.com>
    Cc: Shakeel Butt <shakeel.butt@linux.dev>
    Cc: Shuang Zhai <zhais@google.com>
    Cc: Yu Zhao <yuzhao@google.com>
    Cc: Shuang Zhai <szhai2@cs.rochester.edu>
    Cc: Hugh Dickins <hughd@google.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    8422acdc
huge_memory.c 110 KB