From: Chen Gang <gang.chen@asianux.com>
To: Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm: revert mremap pud_free anti-fix
Date: Tue, 15 Oct 2013 19:46:29 +0800 [thread overview]
Message-ID: <525D2B15.8060503@asianux.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1310150330350.9078@eggly.anvils>
On 10/15/2013 06:34 PM, Hugh Dickins wrote:
> Revert 1ecfd533f4c5 ("mm/mremap.c: call pud_free() after fail calling
> pmd_alloc()"). The original code was correct: pud_alloc(), pmd_alloc(),
> pte_alloc_map() ensure that the pud, pmd, pt is already allocated, and
> seldom do they need to allocate; on failure, upper levels are freed if
> appropriate by the subsequent do_munmap(). Whereas 1ecfd533f4c5 did an
> unconditional pud_free() of a most-likely still-in-use pud: saved only
> by the near-impossiblity of pmd_alloc() failing.
>
What you said above sounds reasonable to me, but better to provide the
information below:
- pud_free() for pgd_alloc() in "arch/arm/mm/pgd.c".
- pud_free() for init_stub_pte() in "arch/um/kernel/skas/mmu.c".
- more details about do_munmap(), (e.g. do it need mm->page_table_lock)
or more details about the demo "most-likely still-in-use pud ...".
Hmm... I am not quite sure about the 3 things, and I will/should
continue analysing/learning about them, but better to get your reply. :-)
Thanks.
> Signed-off-by: Hugh Dickins <hughd@google.com>
> ---
>
> mm/mremap.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> --- 3.12-rc5/mm/mremap.c 2013-09-16 17:37:56.841072270 -0700
> +++ linux/mm/mremap.c 2013-10-15 03:07:09.140091599 -0700
> @@ -25,7 +25,6 @@
> #include <asm/uaccess.h>
> #include <asm/cacheflush.h>
> #include <asm/tlbflush.h>
> -#include <asm/pgalloc.h>
>
> #include "internal.h"
>
> @@ -63,10 +62,8 @@ static pmd_t *alloc_new_pmd(struct mm_st
> return NULL;
>
> pmd = pmd_alloc(mm, pud, addr);
> - if (!pmd) {
> - pud_free(mm, pud);
> + if (!pmd)
> return NULL;
> - }
>
> VM_BUG_ON(pmd_trans_huge(*pmd));
>
>
>
--
Chen Gang
--
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>
WARNING: multiple messages have this Message-ID (diff)
From: Chen Gang <gang.chen@asianux.com>
To: Hugh Dickins <hughd@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm: revert mremap pud_free anti-fix
Date: Tue, 15 Oct 2013 19:46:29 +0800 [thread overview]
Message-ID: <525D2B15.8060503@asianux.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1310150330350.9078@eggly.anvils>
On 10/15/2013 06:34 PM, Hugh Dickins wrote:
> Revert 1ecfd533f4c5 ("mm/mremap.c: call pud_free() after fail calling
> pmd_alloc()"). The original code was correct: pud_alloc(), pmd_alloc(),
> pte_alloc_map() ensure that the pud, pmd, pt is already allocated, and
> seldom do they need to allocate; on failure, upper levels are freed if
> appropriate by the subsequent do_munmap(). Whereas 1ecfd533f4c5 did an
> unconditional pud_free() of a most-likely still-in-use pud: saved only
> by the near-impossiblity of pmd_alloc() failing.
>
What you said above sounds reasonable to me, but better to provide the
information below:
- pud_free() for pgd_alloc() in "arch/arm/mm/pgd.c".
- pud_free() for init_stub_pte() in "arch/um/kernel/skas/mmu.c".
- more details about do_munmap(), (e.g. do it need mm->page_table_lock)
or more details about the demo "most-likely still-in-use pud ...".
Hmm... I am not quite sure about the 3 things, and I will/should
continue analysing/learning about them, but better to get your reply. :-)
Thanks.
> Signed-off-by: Hugh Dickins <hughd@google.com>
> ---
>
> mm/mremap.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> --- 3.12-rc5/mm/mremap.c 2013-09-16 17:37:56.841072270 -0700
> +++ linux/mm/mremap.c 2013-10-15 03:07:09.140091599 -0700
> @@ -25,7 +25,6 @@
> #include <asm/uaccess.h>
> #include <asm/cacheflush.h>
> #include <asm/tlbflush.h>
> -#include <asm/pgalloc.h>
>
> #include "internal.h"
>
> @@ -63,10 +62,8 @@ static pmd_t *alloc_new_pmd(struct mm_st
> return NULL;
>
> pmd = pmd_alloc(mm, pud, addr);
> - if (!pmd) {
> - pud_free(mm, pud);
> + if (!pmd)
> return NULL;
> - }
>
> VM_BUG_ON(pmd_trans_huge(*pmd));
>
>
>
--
Chen Gang
next prev parent reply other threads:[~2013-10-15 11:47 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-15 10:34 [PATCH] mm: revert mremap pud_free anti-fix Hugh Dickins
2013-10-15 10:34 ` Hugh Dickins
2013-10-15 11:46 ` Chen Gang [this message]
2013-10-15 11:46 ` Chen Gang
2013-11-13 7:15 ` Chen Gang
2013-11-13 7:15 ` Chen Gang
2013-11-13 5:06 ` [PATCH] arch: um: kernel: skas: mmu: remove pmd_free() and pud_free() for failure processing in init_stub_pte() Chen Gang
2013-11-13 5:06 ` Chen Gang
2013-11-13 9:07 ` [uml-devel] " Richard Weinberger
2013-11-13 9:07 ` Richard Weinberger
2013-11-13 9:07 ` Richard Weinberger
2013-11-13 9:14 ` [uml-devel] " Chen Gang
2013-11-13 9:14 ` Chen Gang
2013-11-13 9:14 ` Chen Gang
2013-11-14 5:20 ` Hugh Dickins
2013-11-14 5:20 ` Hugh Dickins
2013-11-14 5:20 ` Hugh Dickins
2013-11-14 6:48 ` Chen Gang
2013-11-14 6:48 ` Chen Gang
2013-11-14 6:48 ` Chen Gang
2013-11-14 7:33 ` Chen Gang
2013-11-14 7:33 ` Chen Gang
2013-11-14 7:55 ` Richard Weinberger
2013-11-14 7:55 ` Richard Weinberger
2013-11-14 8:57 ` Chen Gang
2013-11-14 8:57 ` Chen Gang
2013-11-15 2:14 ` [uml-devel] " Chen Gang
2013-11-15 2:14 ` Chen Gang
2013-11-15 2:14 ` Chen Gang
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=525D2B15.8060503@asianux.com \
--to=gang.chen@asianux.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.