From: Hugh Dickins <hughd@google.com>
To: Andrea Arcangeli <aarcange@redhat.com>
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <jweiner@redhat.com>,
Rik van Riel <riel@redhat.com>
Subject: Re: [PATCH] fix rmap walk during fork
Date: Wed, 15 Sep 2010 12:49:05 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.2.00.1009151247390.2604@tigran.mtv.corp.google.com> (raw)
In-Reply-To: <20100915171657.GP5981@random.random>
On Wed, 15 Sep 2010, Andrea Arcangeli wrote:
> From: Andrea Arcangeli <aarcange@redhat.com>
>
> The below bug in fork lead to the rmap walk finding the parent huge-pmd twice
> instead of just one, because the anon_vma_chain objects of the child vma still
> point to the vma->vm_mm of the parent. The below patch fixes it by making the
> rmap walk accurate during fork. It's not a big deal normally but it
> worth being accurate considering the cost is the same.
>
> Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: Hugh Dickins <hughd@google.com>
> ---
>
> diff --git a/kernel/fork.c b/kernel/fork.c
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -360,10 +360,10 @@ static int dup_mmap(struct mm_struct *mm
> if (IS_ERR(pol))
> goto fail_nomem_policy;
> vma_set_policy(tmp, pol);
> + tmp->vm_mm = mm;
> if (anon_vma_fork(tmp, mpnt))
> goto fail_nomem_anon_vma_fork;
> tmp->vm_flags &= ~VM_LOCKED;
> - tmp->vm_mm = mm;
> tmp->vm_next = tmp->vm_prev = NULL;
> file = tmp->vm_file;
> if (file) {
--
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>
next prev parent reply other threads:[~2010-09-15 19:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-15 17:16 Andrea Arcangeli
2010-09-15 19:49 ` Hugh Dickins [this message]
2010-09-15 20:10 ` Johannes Weiner
2010-09-15 20:38 ` Rik van Riel
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=alpine.DEB.2.00.1009151247390.2604@tigran.mtv.corp.google.com \
--to=hughd@google.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=jweiner@redhat.com \
--cc=linux-mm@kvack.org \
--cc=riel@redhat.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