linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Guanjun He <gjhe@suse.com>
To: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: Guanjun He <gjhe@suse.com>
Subject: [PATCH][mm/memory.c]: transparent hugepage check condition missed
Date: Mon, 31 Oct 2011 16:23:32 +0800	[thread overview]
Message-ID: <1320049412-12642-1-git-send-email-gjhe@suse.com> (raw)
In-Reply-To: <transparent-hugepage-check-condition-miss>

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.

Signed-off-by: Guanjun He <gjhe@suse.com>
---
 mm/memory.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/mm/memory.c b/mm/memory.c
index a56e3ba..79b85fe 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -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;
-- 
1.7.3.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

       reply	other threads:[~2011-10-31  8:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <transparent-hugepage-check-condition-miss>
2011-10-31  8:23 ` Guanjun He [this message]
2011-11-01  1:18   ` [PATCH][mm/memory.c]: transparent hugepage check condition missed Shaohua Li
2011-11-01  8:21     ` Guan Jun He
2011-11-01  8:42       ` Shaohua Li
2011-11-01  9:18         ` Guan Jun He

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1320049412-12642-1-git-send-email-gjhe@suse.com \
    --to=gjhe@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).