diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-22 09:05:34 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-22 09:05:34 +0100 |
commit | c318f074d9fdeae16e19cbb2ed53b50d2bcdfdb8 (patch) | |
tree | 44c6552fa919dfe1fc681949bf5d81fcf6a2beb8 /mm/mempolicy.c | |
parent | Merge tag 'iio-for-5.6b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic... (diff) | |
parent | Linux 5.5-rc7 (diff) | |
download | linux-c318f074d9fdeae16e19cbb2ed53b50d2bcdfdb8.tar.xz linux-c318f074d9fdeae16e19cbb2ed53b50d2bcdfdb8.zip |
Merge 5.5-rc7 into staging-next
We want the staging fixes in here as well
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/mempolicy.c')
-rw-r--r-- | mm/mempolicy.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 067cf7d3daf5..b2920ae87a61 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -2148,18 +2148,22 @@ alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, nmask = policy_nodemask(gfp, pol); if (!nmask || node_isset(hpage_node, *nmask)) { mpol_cond_put(pol); + /* + * First, try to allocate THP only on local node, but + * don't reclaim unnecessarily, just compact. + */ page = __alloc_pages_node(hpage_node, - gfp | __GFP_THISNODE, order); + gfp | __GFP_THISNODE | __GFP_NORETRY, order); /* * If hugepage allocations are configured to always * synchronous compact or the vma has been madvised * to prefer hugepage backing, retry allowing remote - * memory as well. + * memory with both reclaim and compact as well. */ if (!page && (gfp & __GFP_DIRECT_RECLAIM)) page = __alloc_pages_node(hpage_node, - gfp | __GFP_NORETRY, order); + gfp, order); goto out; } |