• Pavel Tatashin's avatar
    mm cma: rename PF_MEMALLOC_NOCMA to PF_MEMALLOC_PIN · 1a08ae36
    Pavel Tatashin authored
    PF_MEMALLOC_NOCMA is used ot guarantee that the allocator will not
    return pages that might belong to CMA region.  This is currently used
    for long term gup to make sure that such pins are not going to be done
    on any CMA pages.
    
    When PF_MEMALLOC_NOCMA has been introduced we haven't realized that it
    is focusing on CMA pages too much and that there is larger class of
    pages that need the same treatment.  MOVABLE zone cannot contain any
    long term pins as well so it makes sense to reuse and redefine this flag
    for that usecase as well.  Rename the flag to PF_MEMALLOC_PIN which
    defines an allocation context which can only get pages suitable for
    long-term pins.
    
    Also rename: memalloc_nocma_save()/memalloc_nocma_restore to
    memalloc_pin_save()/memalloc_pin_restore() and make the new functions
    common.
    
    [rppt@linux.ibm.com: fix renaming of PF_MEMALLOC_NOCMA to PF_MEMALLOC_PIN]
      Link: https://lkml.kernel.org/r/20210331163816.11517-1-rppt@kernel.org
    
    Link: https://lkml.kernel.org/r/20210215161349.246722-6-pasha.tatashin@soleen.comSigned-off-by: default avatarPavel Tatashin <pasha.tatashin@soleen.com>
    Reviewed-by: default avatarJohn Hubbard <jhubbard@nvidia.com>
    Acked-by: default avatarMichal Hocko <mhocko@suse.com>
    Signed-off-by: default avatarMike Rapoport <rppt@linux.ibm.com>
    Cc: Dan Williams <dan.j.williams@intel.com>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: David Rientjes <rientjes@google.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Ira Weiny <ira.weiny@intel.com>
    Cc: James Morris <jmorris@namei.org>
    Cc: Jason Gunthorpe <jgg@nvidia.com>
    Cc: Jason Gunthorpe <jgg@ziepe.ca>
    Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Mel Gorman <mgorman@suse.de>
    Cc: Michal Hocko <mhocko@kernel.org>
    Cc: Mike Kravetz <mike.kravetz@oracle.com>
    Cc: Oscar Salvador <osalvador@suse.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Sasha Levin <sashal@kernel.org>
    Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
    Cc: Tyler Hicks <tyhicks@linux.microsoft.com>
    Cc: Vlastimil Babka <vbabka@suse.cz>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    1a08ae36
gup.c 83 KB