From: David Rientjes <rientjes@google.com>
To: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: akpm@linux-foundation.org, tj@kernel.org, linux-mm@kvack.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Grygorii Strashko <grygorii.strashko@ti.com>,
Yinghai Lu <yinghai@kernel.org>
Subject: Re: [PATCH] mm/memblock: use WARN_ONCE when MAX_NUMNODES passed as input parameter
Date: Thu, 26 Dec 2013 15:45:04 -0800 (PST) [thread overview]
Message-ID: <alpine.DEB.2.02.1312261542260.9342@chino.kir.corp.google.com> (raw)
In-Reply-To: <1387578536-18280-1-git-send-email-santosh.shilimkar@ti.com>
On Fri, 20 Dec 2013, Santosh Shilimkar wrote:
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 71b11d9..6af873a 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -707,11 +707,9 @@ void __init_memblock __next_free_mem_range(u64 *idx, int nid,
> struct memblock_type *rsv = &memblock.reserved;
> int mi = *idx & 0xffffffff;
> int ri = *idx >> 32;
> - bool check_node = (nid != NUMA_NO_NODE) && (nid != MAX_NUMNODES);
>
> - if (nid == MAX_NUMNODES)
> - pr_warn_once("%s: Usage of MAX_NUMNODES is depricated. Use NUMA_NO_NODE instead\n",
> - __func__);
> + if (WARN_ONCE(nid == MAX_NUMNODES, "Usage of MAX_NUMNODES is deprecated. Use NUMA_NO_NODE instead\n"))
> + nid = NUMA_NO_NODE;
>
> for ( ; mi < mem->cnt; mi++) {
> struct memblock_region *m = &mem->regions[mi];
Um, why do this at runtime? This is only used for
for_each_free_mem_range(), which is used rarely in x86 and memblock-only
code. I'm struggling to understand why we can't deterministically fix the
callers if this condition is possible.
--
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>
next prev parent reply other threads:[~2013-12-26 23:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-20 22:28 Santosh Shilimkar
2013-12-26 23:45 ` David Rientjes [this message]
2013-12-30 12:13 ` Grygorii Strashko
2014-01-02 22:03 ` David Rientjes
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=alpine.DEB.2.02.1312261542260.9342@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=grygorii.strashko@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=santosh.shilimkar@ti.com \
--cc=tj@kernel.org \
--cc=yinghai@kernel.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