Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1703435
| From | Pavel Tatashin <pasha.tatashin@oracle.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [v5 15/15] mm: debug for raw alloctor |
| Date | 2017-08-03 23:30 +0200 |
| Message-ID | <uavQS-5Ka-29@gated-at.bofh.it> (permalink) |
| References | <uavQR-5Ka-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
When CONFIG_DEBUG_VM is enabled, this patch sets all the memory that is
returned by memblock_virt_alloc_try_nid_raw() to ones to ensure that no
places excpect zeroed memory.
Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com>
Reviewed-by: Steven Sistare <steven.sistare@oracle.com>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Reviewed-by: Bob Picco <bob.picco@oracle.com>
---
mm/memblock.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/mm/memblock.c b/mm/memblock.c
index bdf31f207fa4..b6f90e75946c 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -1363,12 +1363,19 @@ void * __init memblock_virt_alloc_try_nid_raw(
phys_addr_t min_addr, phys_addr_t max_addr,
int nid)
{
+ void *ptr;
+
memblock_dbg("%s: %llu bytes align=0x%llx nid=%d from=0x%llx max_addr=0x%llx %pF\n",
__func__, (u64)size, (u64)align, nid, (u64)min_addr,
(u64)max_addr, (void *)_RET_IP_);
- return memblock_virt_alloc_internal(size, align,
- min_addr, max_addr, nid);
+ ptr = memblock_virt_alloc_internal(size, align,
+ min_addr, max_addr, nid);
+#ifdef CONFIG_DEBUG_VM
+ if (ptr && size > 0)
+ memset(ptr, 0xff, size);
+#endif
+ return ptr;
}
/**
--
2.13.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[v5 00/15] complete deferred page initialization Pavel Tatashin <pasha.tatashin@oracle.com> - 2017-08-03 23:30 +0200 [v5 15/15] mm: debug for raw alloctor Pavel Tatashin <pasha.tatashin@oracle.com> - 2017-08-03 23:30 +0200 [v5 07/15] mm: defining memblock_virt_alloc_try_nid_raw Pavel Tatashin <pasha.tatashin@oracle.com> - 2017-08-03 23:30 +0200 [v5 05/15] mm: don't accessed uninitialized struct pages Pavel Tatashin <pasha.tatashin@oracle.com> - 2017-08-03 23:30 +0200 [v5 06/15] sparc64: simplify vmemmap_populate Pavel Tatashin <pasha.tatashin@oracle.com> - 2017-08-03 23:30 +0200 [v5 04/15] mm: discard memblock data later Pavel Tatashin <pasha.tatashin@oracle.com> - 2017-08-03 23:30 +0200 [v5 08/15] mm: zero struct pages during initialization Pavel Tatashin <pasha.tatashin@oracle.com> - 2017-08-03 23:30 +0200 [v5 12/15] mm: explicitly zero pagetable memory Pavel Tatashin <pasha.tatashin@oracle.com> - 2017-08-03 23:30 +0200
csiph-web