[PATCH v8 1/4] mm/cma: Add PF flag to force non cma alloc

Michal Hocko mhocko at kernel.org
Fri Mar 1 01:34:05 AEDT 2019

On Thu 28-02-19 13:20:03, Vlastimil Babka wrote:
> On 2/27/19 3:47 PM, Aneesh Kumar K.V wrote:
> > This patch adds PF_MEMALLOC_NOCMA which make sure any allocation in that context
> > is marked non-movable and hence cannot be satisfied by CMA region.
> > 
> > This is useful with get_user_pages_longterm where we want to take a page pin by
> > migrating pages from CMA region. Marking the section PF_MEMALLOC_NOCMA ensures
> > that we avoid unnecessary page migration later.
> > 
> > Suggested-by: Andrea Arcangeli <aarcange at redhat.com>
> > Reviewed-by: Andrea Arcangeli <aarcange at redhat.com>
> > Signed-off-by: Aneesh Kumar K.V <aneesh.kumar at linux.ibm.com>
> +CC scheduler guys
> Do we really take the last available PF flag just so that "we avoid
> unnecessary page migration later"?
> If yes, that's a third PF_MEMALLOC flag, should we get separate variable
> for gfp context at this point?

Yes, that sounds like a reasonable thing to do. Just note that xfs still
uses current_{set,restore}* api to handle PF_MEMALLOC_NOFS so that would
have to be moved over to the memalloc_nofs_{save,restore} API.

Michal Hocko

More information about the Linuxppc-dev mailing list