Skip to contentSkip to conversation

: transparent hugepage check condition missed

PATCH Guan Jun He 1 participant 1 message Oct 31, 2011 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Excuse me! I got the one email sent 6 times!

best,
Guanjun

Quoted 1 line
Quoted 1 line
Quoted 1 line

On 10/31/2011 at 05:02 PM, in message

<[email protected]>, Guanjun He <[email protected]>

Quoted 28 lines · wrote:

For the transparent hugepage module still does not support tmpfs and cache,the check condition should always be checked to make sure that it only affect the anonymous maps, the original check condition missed this, this patch is to fix this. Otherwise,the hugepage may affect the file-backed maps, then the cache for the small-size pages will be unuseful, and till now there is still no implementation for hugepage's cache.

---
 mm/memory.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
mm/memory.c +2 -1
index a56e3ba..79b85fe 100644
@@ -3475,7 +3475,8 @@ int handle_mm_fault(struct mm_struct *mm, struct 
 vm_area_struct *vma,
 		if (pmd_trans_huge(orig_pmd)) {
 			if (flags & FAULT_FLAG_WRITE &&
 			    !pmd_write(orig_pmd) &&
-			    !pmd_trans_splitting(orig_pmd))
+			    !pmd_trans_splitting(orig_pmd) &&
+			    !vma->vm_ops)
 				return do_huge_pmd_wp_page(mm, vma, address,
 							   pmd, orig_pmd);

return 0;