linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Wenwei Tao <wenweitaowenwei@gmail.com>
To: izik.eidus@ravellosystems.com, aarcange@redhat.com,
	chrisw@sous-sol.org, hughd@google.com, tglx@linutronix.de,
	mingo@redhat.com, hpa@zytor.com, x86@kernel.org,
	viro@zeniv.linux.org.uk
Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	kvm@vger.kernel.org, kvm-ppc@vger.kernel.org,
	wenweitaowenwei@gmail.com
Subject: [RFC PATCH 4/6] fs/binfmt_elf.c: change the condition of identifying hugetlb vm
Date: Wed, 10 Jun 2015 14:27:17 +0800	[thread overview]
Message-ID: <1433917639-31699-5-git-send-email-wenweitaowenwei@gmail.com> (raw)
In-Reply-To: <1433917639-31699-1-git-send-email-wenweitaowenwei@gmail.com>

Hugetlb VMAs are not mergeable, that means a VMA couldn't have VM_HUGETLB and
VM_MERGEABLE been set in the same time. So we use VM_HUGETLB to indicate new
mergeable VMAs. Because of that a VMA which has VM_HUGETLB been set is a hugetlb
VMA only if it doesn't have VM_MERGEABLE been set in the same time.

Signed-off-by: Wenwei Tao <wenweitaowenwei@gmail.com>
---
 fs/binfmt_elf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 995986b..f529c8e 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1242,7 +1242,7 @@ static unsigned long vma_dump_size(struct vm_area_struct *vma,
 		return 0;
 
 	/* Hugetlb memory check */
-	if (vma->vm_flags & VM_HUGETLB) {
+	if ((vma->vm_flags & (VM_HUGETLB | VM_MERGEABLE)) == VM_HUGETLB) {
 		if ((vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_SHARED))
 			goto whole;
 		if (!(vma->vm_flags & VM_SHARED) && FILTER(HUGETLB_PRIVATE))
-- 
1.7.9.5

  parent reply	other threads:[~2015-06-10  6:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-10  6:27 [RFC PATCH 0/6] add defer mechanism to ksm to make it more suitable for Android devices Wenwei Tao
2015-06-10  6:27 ` [RFC PATCH 1/6] mm: add defer mechanism to ksm to make it more suitable Wenwei Tao
2015-06-10  6:27 ` [RFC PATCH 2/6] mm: change the condition of identifying hugetlb vm Wenwei Tao
2015-06-10  6:27 ` [RFC PATCH 3/6] perf: " Wenwei Tao
2015-06-10  6:27 ` Wenwei Tao [this message]
2015-06-10  6:27 ` [RFC PATCH 5/6] x86/mm: " Wenwei Tao
2015-06-10  6:27 ` [RFC PATCH 6/6] powerpc/kvm: " Wenwei Tao
2015-07-02 21:49   ` Scott Wood
2015-07-03  8:47     ` wenwei tao
2015-07-06 21:34       ` Scott Wood
2015-07-07  8:05         ` wenwei tao
2015-07-07 19:47           ` Scott Wood

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=1433917639-31699-5-git-send-email-wenweitaowenwei@gmail.com \
    --to=wenweitaowenwei@gmail.com \
    --cc=aarcange@redhat.com \
    --cc=chrisw@sous-sol.org \
    --cc=hpa@zytor.com \
    --cc=hughd@google.com \
    --cc=izik.eidus@ravellosystems.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    --cc=x86@kernel.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).