[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 7 Jul 2020 13:46:14 +0200
From: Michal Hocko <mhocko@...nel.org>
To: js1304@...il.com
Cc: Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, kernel-team@....com,
Vlastimil Babka <vbabka@...e.cz>,
Christoph Hellwig <hch@...radead.org>,
Roman Gushchin <guro@...com>,
Mike Kravetz <mike.kravetz@...cle.com>,
Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>
Subject: Re: [PATCH v4 07/11] mm/gup: use a standard migration target
allocation callback
On Tue 07-07-20 16:44:45, Joonsoo Kim wrote:
[...]
> @@ -1551,9 +1552,12 @@ struct page *alloc_migration_target(struct page *page, unsigned long private)
>
> gfp_mask |= htlb_alloc_mask(h);
> return alloc_huge_page_nodemask(h, nid, mtc->nmask,
> - gfp_mask, false);
> + gfp_mask, mtc->skip_cma);
> }
>
> + if (mtc->skip_cma)
> + flags = memalloc_nocma_save();
> +
As already mentioned in previous email this is a completely wrong usage
of the scope API. The scope should be defined by the caller and this
should be all transparent by the allocator layer.
> if (PageTransHuge(page)) {
> /*
> * clear __GFP_RECALIM since GFP_TRANSHUGE is the gfp_mask
> @@ -1572,6 +1576,9 @@ struct page *alloc_migration_target(struct page *page, unsigned long private)
> if (new_page && PageTransHuge(new_page))
> prep_transhuge_page(new_page);
>
> + if (mtc->skip_cma)
> + memalloc_nocma_restore(flags);
> +
> return new_page;
> }
>
> --
> 2.7.4
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists