lkml.org 
[lkml]   [2016]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH mmotm 2/5] huge tmpfs: fix mlocked meminfo track huge unhuge mlocks fix
Please add this fix after
huge-tmpfs-fix-mlocked-meminfo-track-huge-unhuge-mlocks.patch
for later merging into it. I expect this to fix a build problem found
by robot on an x86_64 randconfig. I was not able to reproduce the error,
but I'm growing to realize that different optimizers behave differently.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Hugh Dickins <hughd@google.com>
---
mm/rmap.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -1445,8 +1445,12 @@ static int try_to_unmap_one(struct page
*/
if (!(flags & TTU_IGNORE_MLOCK)) {
if (vma->vm_flags & VM_LOCKED) {
+ int nr_pages = 1;
+
+ if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) && !pte)
+ nr_pages = HPAGE_PMD_NR;
/* Holding pte lock, we do *not* need mmap_sem here */
- mlock_vma_pages(page, pte ? 1 : HPAGE_PMD_NR);
+ mlock_vma_pages(page, nr_pages);
ret = SWAP_MLOCK;
goto out_unmap;
}
\
 
 \ /
  Last update: 2016-04-17 01:41    [W:0.079 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site