linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: Guanshun Liu <lgs156412@gmail.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] memblock: export memblock_free() to free reserved memory.
Date: Wed, 26 Jun 2024 08:02:41 +0300	[thread overview]
Message-ID: <Znug8e2cUzuA9qGu@kernel.org> (raw)
In-Reply-To: <20240625121652.1189095-1-lgs156412@gmail.com>

On Tue, Jun 25, 2024 at 08:16:52PM +0800, Guanshun Liu wrote:
> On architectures that support the preservation of memblock metadata
> after __init, allow drivers to call memblock_free() to free a
> reservation configured in dts. This is a hack to support the

"This is a hack" implies that it's not a proper solution, right?

And anyway, memblock_free() will not actually free the memory after __init.

> freeing of bootsplash reservations passed to Linux by the bootloader.
> 
> Signed-off-by: Guanshun Liu <lgs156412@gmail.com>
> ---
>  mm/memblock.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 6d18485571b4..20e7f81fc076 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -848,6 +848,9 @@ void __init_memblock memblock_free(void *ptr, size_t size)
>  	if (ptr)
>  		memblock_phys_free(__pa(ptr), size);
>  }
> +#ifdef CONFIG_ARCH_KEEP_MEMBLOCK
> +EXPORT_SYMBOL_GPL(memblock_free);
> +#endif
>  
>  /**
>   * memblock_phys_free - free boot memory block
> -- 
> 2.25.1
> 

-- 
Sincerely yours,
Mike.


  parent reply	other threads:[~2024-06-26  5:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25 12:16 [PATCH v2] memblock: export memblock_free() to free reserved memory Guanshun Liu
2024-06-25 15:53 ` Christoph Hellwig
2024-06-26  5:02 ` Mike Rapoport [this message]
2024-07-01  8:31   ` liangxi Liu
2024-07-01  8:46   ` liangxi Liu
2024-07-12  8:04   ` liangxi Liu

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=Znug8e2cUzuA9qGu@kernel.org \
    --to=rppt@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=lgs156412@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).