From: Mike Rapoport <rppt@kernel.org>
To: Leesoo Ahn <lsahn@ooseel.net>
Cc: Leesoo Ahn <lsahn@wewakecorp.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mm/sparse: use MEMBLOCK_ALLOC_ACCESSIBLE enum instead of 0
Date: Tue, 11 Jun 2024 10:56:25 +0300 [thread overview]
Message-ID: <ZmgDKWtrcXRL-4rs@kernel.org> (raw)
In-Reply-To: <20240610151528.943680-1-lsahn@wewakecorp.com>
On Tue, Jun 11, 2024 at 12:15:28AM +0900, Leesoo Ahn wrote:
> Setting 'limit' variable to 0 might seem like it means "no limit". But
> in the memblock API, 0 actually means the 'MEMBLOCK_ALLOC_ACCESSIBLE'
> enum, which limits the physical address range end based on
> 'memblock.current_limit'. This could be confusing.
>
> Use the enum instead of 0 to make it clear.
>
> Signed-off-by: Leesoo Ahn <lsahn@ooseel.net>
Acked-by: Mike Rapoport (IBM) <rppt@kernel.org>
> ---
> v1 -> v2: do not rename 'limit' to 'limit_or_flag'
> ---
> mm/sparse.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/sparse.c b/mm/sparse.c
> index de40b2c73406..cf93abc542ca 100644
> --- a/mm/sparse.c
> +++ b/mm/sparse.c
> @@ -351,7 +351,7 @@ sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat,
> again:
> usage = memblock_alloc_try_nid(size, SMP_CACHE_BYTES, goal, limit, nid);
> if (!usage && limit) {
> - limit = 0;
> + limit = MEMBLOCK_ALLOC_ACCESSIBLE;
> goto again;
> }
> return usage;
> --
> 2.34.1
>
--
Sincerely yours,
Mike.
prev parent reply other threads:[~2024-06-11 7:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-10 15:15 Leesoo Ahn
2024-06-11 2:14 ` Wei Yang
2024-06-11 7:56 ` Mike Rapoport [this message]
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=ZmgDKWtrcXRL-4rs@kernel.org \
--to=rppt@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lsahn@ooseel.net \
--cc=lsahn@wewakecorp.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