From: Andrea Arcangeli <aarcange@redhat.com>
To: GuanJun He <heguanbo@gmail.com>
Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH][mm/memory.c]: transparent hugepage check condition missed
Date: Wed, 23 Nov 2011 01:10:08 +0100 [thread overview]
Message-ID: <20111123001008.GF8397@redhat.com> (raw)
In-Reply-To: <CAGW+__+9jOaSdmqGcdCTi+EnRyyNcZ3hFqdqpf3Nxjqb8ZQPbw@mail.gmail.com>
Hi,
On Mon, Oct 31, 2011 at 06:56:57PM +0800, GuanJun He 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.
>
> 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;
Not needed, this is the cow case and pmd_trans_huge can't be true if
vm_ops is not null. That's already checked a few lines before the
above code and in collapse_huge_page for khugepaged.
Thanks.
next prev parent reply other threads:[~2011-11-23 0:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-31 10:56 [PATCH][mm/memory.c]: transparent hugepage check condition missed GuanJun He
2011-11-23 0:10 ` Andrea Arcangeli [this message]
[not found] <1320051775-13992-1-git-send-email-gjhe@suse.com>
2011-10-31 9:26 ` Guan Jun He
[not found] <transparent-hugepage-check-condition-miss>
2011-10-31 8:23 ` Guanjun He
2011-11-01 1:18 ` Shaohua Li
2011-11-01 1:18 ` Shaohua Li
2011-11-01 8:21 ` Guan Jun He
2011-11-01 8:21 ` Guan Jun He
2011-11-01 8:42 ` Shaohua Li
2011-11-01 8:42 ` Shaohua Li
2011-11-01 9:18 ` Guan Jun He
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=20111123001008.GF8397@redhat.com \
--to=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=heguanbo@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.