linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: wenwei tao <wenweitaowenwei@gmail.com>
To: Scott Wood <scottwood@freescale.com>
Cc: Izik Eidus <izik.eidus@ravellosystems.com>,
	aarcange@redhat.com, chrisw@sous-sol.org,
	Hugh Dickins <hughd@google.com>,
	tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
	x86@kernel.org, viro@zeniv.linux.org.uk, 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
Subject: Re: [RFC PATCH 6/6] powerpc/kvm: change the condition of identifying hugetlb vm
Date: Fri, 3 Jul 2015 16:47:42 +0800	[thread overview]
Message-ID: <CAD=trs9bjbeG=NF0UjFBTvL23rF8rry5myhKi_a-rFL4u=7EuQ@mail.gmail.com> (raw)
In-Reply-To: <1435873760.10531.11.camel@freescale.com>

Hi Scott

Thank you for your comments.

Kernel already has that function: is_vm_hugetlb_page() , but the
original code didn't use it,
in order to keep the coding style of the original code, I didn't use it either.

For the sentence like: "vma->vm_flags & VM_HUGETLB" , hiding it behind
'is_vm_hugetlb_page()' is ok,
but the sentence like: "vma->vm_flags &
(VM_LOCKED|VM_HUGETLB|VM_PFNMAP)" appears in the patch 2/6,
is it better to hide the bit combinations behind the
is_vm_hugetlb_page() ?  In my patch I just replaced it with
"vma->vm_flags & (VM_LOCKED|VM_PFNMAP) ||  (vma->vm_flags &
(VM_HUGETLB|VM_MERGEABLE)) == VM_HUGETLB".

I am a newbie to Linux kernel, do you have any good suggestions on
this situation?

Thank you
Wenwei

2015-07-03 5:49 GMT+08:00 Scott Wood <scottwood@freescale.com>:
> On Wed, 2015-06-10 at 14:27 +0800, Wenwei Tao wrote:
>> 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.
>
> Eww.
>
> If you must overload such bit combinations, please hide it behind a
> vm_is_hugetlb() function.
>
> -Scott
>

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2015-07-03  8:47 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 ` [RFC PATCH 4/6] fs/binfmt_elf.c: " Wenwei Tao
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 [this message]
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='CAD=trs9bjbeG=NF0UjFBTvL23rF8rry5myhKi_a-rFL4u=7EuQ@mail.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=scottwood@freescale.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