[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180704001235.w7xexi3jp6ostas5@ca-dmjordan1.us.oracle.com>
Date: Tue, 3 Jul 2018 17:12:35 -0700
From: Daniel Jordan <daniel.m.jordan@...cle.com>
To: "Huang, Ying" <ying.huang@...el.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Michal Hocko <mhocko@...e.com>,
Johannes Weiner <hannes@...xchg.org>,
Shaohua Li <shli@...nel.org>, Hugh Dickins <hughd@...gle.com>,
Minchan Kim <minchan@...nel.org>,
Rik van Riel <riel@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
Zi Yan <zi.yan@...rutgers.edu>
Subject: Re: [PATCH -mm -v4 08/21] mm, THP, swap: Support to read a huge swap
cluster for swapin a THP
On Fri, Jun 22, 2018 at 11:51:38AM +0800, Huang, Ying wrote:
> @@ -411,14 +414,32 @@ struct page *__read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask,
...
> + if (thp_swap_supported() && huge_cluster) {
> + gfp_t gfp = alloc_hugepage_direct_gfpmask(vma);
> +
> + new_page = alloc_hugepage_vma(gfp, vma,
> + addr, HPAGE_PMD_ORDER);
When allocating a huge page, we ignore the gfp_mask argument.
That doesn't matter right now since AFAICT we're not losing any flags: gfp_mask
from existing callers of __read_swap_cache_async seems to always be a subset of
GFP_HIGHUSER_MOVABLE and alloc_hugepage_direct_gfpmask always returns a
superset of that.
But maybe we should warn here in case we end up violating a restriction from a
future caller. Something like this?:
> + gfp_t gfp = alloc_hugepage_direct_gfpmask(vma);
VM_WARN_ONCE((gfp | gfp_mask) != gfp,
"ignoring gfp_mask bits");
Powered by blists - more mailing lists