[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m2k4fj18v1.fsf@firstfloor.org>
Date: Mon, 28 Mar 2011 09:57:06 -0700
From: Andi Kleen <andi@...stfloor.org>
To: Shaohua Li <shaohua.li@...el.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-mm <linux-mm@...ck.org>,
lkml <linux-kernel@...r.kernel.org>,
Rik van Riel <riel@...hat.com>,
Hugh Dickins <hughd@...gle.com>
Subject: Re: [PATCH]mmap: not merge cloned VMA
Shaohua Li <shaohua.li@...el.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@...ux.intel.com -- Speaking for myself only
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists