[<prev] [next>] [day] [month] [year] [list]
Date: Fri, 23 Sep 2016 20:21:56 -0700 (PDT)
From: Hugh Dickins <hughd@...gle.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
cc: Andrew Morton <akpm@...ux-foundation.org>,
Toshi Kani <toshi.kani@....com>,
Hillf Danton <hillf.zj@...baba-inc.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: [PATCH 1/3] shmem: fix tmpfs to handle the huge= option properly
From: Toshi Kani <toshi.kani@....com>
shmem_get_unmapped_area() checks SHMEM_SB(sb)->huge incorrectly,
which leads to a reversed effect of "huge=" mount option.
Fix the check in shmem_get_unmapped_area().
Note, the default value of SHMEM_SB(sb)->huge remains as
SHMEM_HUGE_NEVER. User will need to specify "huge=" option to
enable huge page mappings.
Reported-by: Hillf Danton <hillf.zj@...baba-inc.com>
Signed-off-by: Toshi Kani <toshi.kani@....com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@...ux.vnet.ibm.com>
Signed-off-by: Hugh Dickins <hughd@...gle.com>
---
mm/shmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- 4.8-rc7/mm/shmem.c 2016-08-14 20:17:02.388843463 -0700
+++ linux/mm/shmem.c 2016-09-22 19:41:29.057848626 -0700
@@ -1980,7 +1980,7 @@ unsigned long shmem_get_unmapped_area(st
return addr;
sb = shm_mnt->mnt_sb;
}
- if (SHMEM_SB(sb)->huge != SHMEM_HUGE_NEVER)
+ if (SHMEM_SB(sb)->huge == SHMEM_HUGE_NEVER)
return addr;
}
Powered by blists - more mailing lists