From: Andi Kleen <andi@firstfloor.org>
To: Shaohua Li <shaohua.li@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm <linux-mm@kvack.org>,
lkml <linux-kernel@vger.kernel.org>,
Rik van Riel <riel@redhat.com>, Hugh Dickins <hughd@google.com>
Subject: Re: [PATCH]mmap: not merge cloned VMA
Date: Mon, 28 Mar 2011 09:57:06 -0700 [thread overview]
Message-ID: <m2k4fj18v1.fsf@firstfloor.org> (raw)
In-Reply-To: <1301277534.3981.26.camel@sli10-conroe> (Shaohua Li's message of "Mon, 28 Mar 2011 09:58:54 +0800")
Shaohua Li <shaohua.li@intel.com> writes:
> Avoid merging a VMA with another VMA which is cloned from parent process. The
> cloned VMA shares lock with parent process's VMA. If we do the merge, more vma
> area (even the new range is only for current process) uses perent process's
> anon_vma lock, so introduces scalability issues.
> find_mergeable_anon_vma already considers this.
In theory this could prevent quite some VMA merging, but I guess the
tradeoff is worth it and that should be unlikely to hit anyways.
> static inline int is_mergeable_anon_vma(struct anon_vma *anon_vma1,
> - struct anon_vma *anon_vma2)
> + struct anon_vma *anon_vma2,
> + struct vm_area_struct *vma)
> {
> - return !anon_vma1 || !anon_vma2 || (anon_vma1 == anon_vma2);
> + if ((!anon_vma1 || !anon_vma2) && (!vma ||
> + list_is_singular(&vma->anon_vma_chain)))
> + return 1;
I think this if () needs a comment.
-Andi
--
ak@linux.intel.com -- Speaking for myself only
--
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>
next prev parent reply other threads:[~2011-03-28 16:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-28 1:58 Shaohua Li
2011-03-28 16:57 ` Andi Kleen [this message]
2011-03-29 0:53 ` Shaohua Li
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=m2k4fj18v1.fsf@firstfloor.org \
--to=andi@firstfloor.org \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=riel@redhat.com \
--cc=shaohua.li@intel.com \
/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