From: skseofh@gmail.com
To: robh@kernel.org, saravanak@google.com, rppt@kernel.org,
akpm@linux-foundation.org
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Subject: [PATCH v2] memblock: add no-map alloc functions
Date: Tue, 16 Apr 2024 21:06:34 +0900 [thread overview]
Message-ID: <20240416120635.361838-1-skseofh@gmail.com> (raw)
In-Reply-To: <linux-mm@kvack.org>
> > From: Daero Lee <daero_le.lee@samsung.com>
> >
> > Like reserved-memory with the no-map property, there are memory regions
> > need to be allocated in memblock.memory marked with the
> > MEMBLOCK_NOMAP flag, but sholud not be allocated in memblock.reserved.
>
> Can you please explain your use case?
> Why do you need this functionality?
Thank you for your comments.
I added a example to the commit message.
> > So, functions were added that find the required memory area in
> > memblock.memory, but do not allocate it to memblock.reserved.
> >
> > The early_init_dt_alloc_reserved_memory_arch function was modified
> > using the no-map alloc function.
> >
> > Signed-off-by: Daero Lee <daero_le.lee@samsung.com>
> > ---
> > drivers/of/of_reserved_mem.c | 9 +++--
> > mm/memblock.c | 78 ++++++++++++++++++++++++++++++++++++
> > 2 files changed, 84 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
> > index 8236ecae2953..504f2f60689c 100644
> > --- a/drivers/of/of_reserved_mem.c
> > +++ b/drivers/of/of_reserved_mem.c
> > @@ -40,15 +40,18 @@ static int __init early_init_dt_alloc_reserved_memory_arch(phys_addr_t size,
> >
> > end = !end ? MEMBLOCK_ALLOC_ANYWHERE : end;
> > align = !align ? SMP_CACHE_BYTES : align;
> > - base = memblock_phys_alloc_range(size, align, start, end);
> > + if (nomap) {
> > + base = memblock_phys_alloc_range_nomap(size, align, start, end);
> > + } else {
> > + base = memblock_phys_alloc_range(size, align, start, end);
> > + }
> > +
>
> This changes behaviour of internal function, what effect will it have on
> the users?
I added explanation about this to the commit message, too.
Thank you.
next reply other threads:[~2024-04-16 12:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-16 12:06 skseofh [this message]
2024-04-16 12:06 ` [PATCH v2] memblock: add no-map alloc functions skseofh
2024-04-17 2:23 ` Wei Yang
2024-04-17 6:02 ` Mike Rapoport
2024-04-18 14:54 ` DaeRo Lee
2024-04-18 18:03 ` Mike Rapoport
2024-04-19 1:46 ` DaeRo Lee
2024-04-19 1:59 ` DaeRo Lee
2024-04-27 8:49 ` Mike Rapoport
2024-04-27 10:24 ` DaeRo Lee
2024-04-28 6:33 ` Mike Rapoport
2024-04-28 10:36 ` DaeRo Lee
2024-04-28 12:00 ` Mike Rapoport
2024-04-28 12:52 ` DaeRo Lee
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=20240416120635.361838-1-skseofh@gmail.com \
--to=skseofh@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=robh@kernel.org \
--cc=rppt@kernel.org \
--cc=saravanak@google.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;
as well as URLs for NNTP newsgroup(s).