All of lore.kernel.org
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64:free_initrd_mem should also free the memblock
Date: Mon, 15 Sep 2014 19:33:34 +0100	[thread overview]
Message-ID: <20140915183334.GA30737@arm.com> (raw)
In-Reply-To: <35FD53F367049845BC99AC72306C23D103CDBFBFB029@CNBJMBX05.corpusers.net>

On Fri, Sep 12, 2014 at 11:17:18AM +0100, Wang, Yalin wrote:
> this patch fix the memblock statics for memblock
> in file /sys/kernel/debug/memblock/reserved
> if we don't call memblock_free the initrd will still
> be marked as reserved, even they are freed.
> 
> Signed-off-by: Yalin Wang <yalin.wang@sonymobile.com>
> ---
>  arch/arm64/mm/init.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
> index 5472c24..34605c8 100644
> --- a/arch/arm64/mm/init.c
> +++ b/arch/arm64/mm/init.c
> @@ -334,8 +334,10 @@ static int keep_initrd;
>  
>  void free_initrd_mem(unsigned long start, unsigned long end)
>  {
> -	if (!keep_initrd)
> +	if (!keep_initrd) {
>  		free_reserved_area((void *)start, (void *)end, 0, "initrd");
> +		memblock_free(__pa(start), end - start);
> +	}

I don't think it makes any technical difference, but doing the memblock_free
before the free_reserved_area makes more sense to me.

Will

WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will.deacon@arm.com>
To: "Wang, Yalin" <Yalin.Wang@sonymobile.com>
Cc: "'linux@arm.linux.org.uk'" <linux@arm.linux.org.uk>,
	"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
	"'linux-arm-kernel@lists.infradead.org'"
	<linux-arm-kernel@lists.infradead.org>,
	"'linux-mm@kvack.org'" <linux-mm@kvack.org>
Subject: Re: [PATCH] arm64:free_initrd_mem should also free the memblock
Date: Mon, 15 Sep 2014 19:33:34 +0100	[thread overview]
Message-ID: <20140915183334.GA30737@arm.com> (raw)
In-Reply-To: <35FD53F367049845BC99AC72306C23D103CDBFBFB029@CNBJMBX05.corpusers.net>

On Fri, Sep 12, 2014 at 11:17:18AM +0100, Wang, Yalin wrote:
> this patch fix the memblock statics for memblock
> in file /sys/kernel/debug/memblock/reserved
> if we don't call memblock_free the initrd will still
> be marked as reserved, even they are freed.
> 
> Signed-off-by: Yalin Wang <yalin.wang@sonymobile.com>
> ---
>  arch/arm64/mm/init.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
> index 5472c24..34605c8 100644
> --- a/arch/arm64/mm/init.c
> +++ b/arch/arm64/mm/init.c
> @@ -334,8 +334,10 @@ static int keep_initrd;
>  
>  void free_initrd_mem(unsigned long start, unsigned long end)
>  {
> -	if (!keep_initrd)
> +	if (!keep_initrd) {
>  		free_reserved_area((void *)start, (void *)end, 0, "initrd");
> +		memblock_free(__pa(start), end - start);
> +	}

I don't think it makes any technical difference, but doing the memblock_free
before the free_reserved_area makes more sense to me.

Will

--
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: Will Deacon <will.deacon@arm.com>
To: "Wang, Yalin" <Yalin.Wang@sonymobile.com>
Cc: "'linux@arm.linux.org.uk'" <linux@arm.linux.org.uk>,
	"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
	"'linux-arm-kernel@lists.infradead.org'" 
	<linux-arm-kernel@lists.infradead.org>,
	"'linux-mm@kvack.org'" <linux-mm@kvack.org>
Subject: Re: [PATCH] arm64:free_initrd_mem should also free the memblock
Date: Mon, 15 Sep 2014 19:33:34 +0100	[thread overview]
Message-ID: <20140915183334.GA30737@arm.com> (raw)
In-Reply-To: <35FD53F367049845BC99AC72306C23D103CDBFBFB029@CNBJMBX05.corpusers.net>

On Fri, Sep 12, 2014 at 11:17:18AM +0100, Wang, Yalin wrote:
> this patch fix the memblock statics for memblock
> in file /sys/kernel/debug/memblock/reserved
> if we don't call memblock_free the initrd will still
> be marked as reserved, even they are freed.
> 
> Signed-off-by: Yalin Wang <yalin.wang@sonymobile.com>
> ---
>  arch/arm64/mm/init.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
> index 5472c24..34605c8 100644
> --- a/arch/arm64/mm/init.c
> +++ b/arch/arm64/mm/init.c
> @@ -334,8 +334,10 @@ static int keep_initrd;
>  
>  void free_initrd_mem(unsigned long start, unsigned long end)
>  {
> -	if (!keep_initrd)
> +	if (!keep_initrd) {
>  		free_reserved_area((void *)start, (void *)end, 0, "initrd");
> +		memblock_free(__pa(start), end - start);
> +	}

I don't think it makes any technical difference, but doing the memblock_free
before the free_reserved_area makes more sense to me.

Will

  reply	other threads:[~2014-09-15 18:33 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12 10:17 [PATCH] arm64:free_initrd_mem should also free the memblock Wang, Yalin
2014-09-12 10:17 ` Wang, Yalin
2014-09-12 10:17 ` Wang, Yalin
2014-09-15 18:33 ` Will Deacon [this message]
2014-09-15 18:33   ` Will Deacon
2014-09-15 18:33   ` Will Deacon
2014-09-15 18:40   ` Russell King - ARM Linux
2014-09-15 18:40     ` Russell King - ARM Linux
2014-09-15 18:40     ` Russell King - ARM Linux
2014-09-15 18:50     ` Will Deacon
2014-09-15 18:50       ` Will Deacon
2014-09-15 18:50       ` Will Deacon
2014-09-16  1:53       ` Wang, Yalin
2014-09-16  1:53         ` Wang, Yalin
2014-09-16  1:53         ` Wang, Yalin
2014-09-17 16:28         ` Catalin Marinas
2014-09-17 16:28           ` Catalin Marinas
2014-09-17 16:28           ` Catalin Marinas
2014-09-17 18:12           ` Russell King - ARM Linux
2014-09-17 18:12             ` Russell King - ARM Linux
2014-09-17 18:12             ` Russell King - ARM Linux
2014-09-18  9:38             ` Wang, Yalin
2014-09-18  9:38               ` Wang, Yalin
2014-09-18  9:38               ` Wang, Yalin
2014-09-18  9:59               ` Russell King - ARM Linux
2014-09-18  9:59                 ` Russell King - ARM Linux
2014-09-18  9:59                 ` Russell King - ARM Linux
2014-09-18 12:13                 ` Wang, Yalin
2014-09-18 12:13                   ` Wang, Yalin
2014-09-18 12:13                   ` Wang, Yalin

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=20140915183334.GA30737@arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.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.