From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: santosh.shilimkar@ti.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org,
Grygorii Strashko <grygorii.strashko@ti.com>,
Yinghai Lu <yinghai@kernel.org>, Tejun Heo <tj@kernel.org>
Subject: [PATCH 1/2] mm/memblock: add more comments in code
Date: Wed, 11 Dec 2013 17:36:13 +0200 [thread overview]
Message-ID: <1386776175-23779-1-git-send-email-grygorii.strashko@ti.com> (raw)
Add additional description on:
- why warning is produced in case if slab is ready
- why kmemleak_alloc is called for each allocated memory block
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
It's additional change on top of the memblock series
https://lkml.org/lkml/2013/12/9/715
mm/memblock.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/mm/memblock.c b/mm/memblock.c
index d03d50a..974f0d3 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -985,6 +985,11 @@ static void * __init memblock_virt_alloc_internal(
pr_warn("%s: usage of MAX_NUMNODES is depricated. Use NUMA_NO_NODE\n",
__func__);
+ /*
+ * Detect any accidental use of these APIs after slab is ready, as at
+ * this moment memblock may be deinitialized already and its
+ * internal data may be destroyed (after execution of free_all_bootmem)
+ */
if (WARN_ON_ONCE(slab_is_available()))
return kzalloc_node(size, GFP_NOWAIT, nid);
@@ -1021,7 +1026,9 @@ done:
/*
* The min_count is set to 0 so that bootmem allocated blocks
- * are never reported as leaks.
+ * are never reported as leaks. This is because many of these blocks
+ * are only referred via the physical address which is not
+ * looked up by kmemleak.
*/
kmemleak_alloc(ptr, size, 0, 0);
--
1.7.9.5
--
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 reply other threads:[~2013-12-11 14:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-11 15:36 Grygorii Strashko [this message]
2013-12-11 15:36 ` [PATCH 2/2] mm/memblock: print phys_addr_t using %pa Grygorii Strashko
2013-12-11 22:10 ` Andrew Morton
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=1386776175-23779-1-git-send-email-grygorii.strashko@ti.com \
--to=grygorii.strashko@ti.com \
--cc=akpm@linux-foundation.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