[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTin9UTy3qSWJ8u3b1hwhnsX5NHCZNzkFbH9_-vIZ@mail.gmail.com>
Date: Thu, 10 Jun 2010 09:30:12 +0800
From: Dave Young <hidave.darkstar@...il.com>
To: Rik van Riel <riel@...hat.com>
Cc: Catalin Marinas <catalin.marinas@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-mm@...ck.org
Subject: Re: [PATCH -mm] only drop root anon_vma if not self
On Thu, Jun 10, 2010 at 9:16 AM, Rik van Riel <riel@...hat.com> wrote:
> On Wed, 9 Jun 2010 17:19:02 +0800
> Dave Young <hidave.darkstar@...il.com> wrote:
>
>> > Manually bisected mm patches, the memleak caused by following patch:
>> >
>> > mm-extend-ksm-refcounts-to-the-anon_vma-root.patch
>>
>>
>> So I guess the refcount break, either drop-without-get or over-drop
>
> I'm guessing I did not run the kernel with enough debug options enabled
> when I tested my patches...
>
> Dave & Catalin, thank you for tracking this down.
>
> Dave, does the below patch fix your issue?
Yes, it fixed the issue. Thanks.
Tested-by: Dave Young <hidave.darkstar@...il.com>
>
> Andrew, if the patch below works, you'll probably want to merge it as
> mm-extend-ksm-refcounts-to-the-anon_vma-root-fix.patch :)
>
> ----------------
>
> With the new anon_vma code we take a refcount on the root anon_vma.
> However, the root anon_vma does not have a refcount on itself, so
> we should not try to do a drop on itself when it is being unlinked.
>
> Signed-off-by: Rik van Riel <riel@...hat.com>
>
> --- linux-2.6-rtavma/mm/rmap.c.orig 2010-06-09 21:10:07.349376896 -0400
> +++ linux-2.6-rtavma/mm/rmap.c 2010-06-09 21:10:24.180406299 -0400
> @@ -275,7 +275,8 @@ static void anon_vma_unlink(struct anon_
>
> if (empty) {
> /* We no longer need the root anon_vma */
> - drop_anon_vma(anon_vma->root);
> + if (anon_vma->root != anon_vma)
> + drop_anon_vma(anon_vma->root);
> anon_vma_free(anon_vma);
> }
> }
>
--
Regards
dave
--
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