lkml.org 
[lkml]   [2017]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[v6 12/15] mm: explicitly zero pagetable memory
Date
Soon vmemmap_alloc_block() will no longer zero the block, so zero memory
at its call sites for everything except struct pages. Struct page memory
is zero'd by struct page initialization.

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/sparse-vmemmap.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
index c50b1a14d55e..d40c721ab19f 100644
--- a/mm/sparse-vmemmap.c
+++ b/mm/sparse-vmemmap.c
@@ -191,6 +191,7 @@ pmd_t * __meminit vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node)
void *p = vmemmap_alloc_block(PAGE_SIZE, node);
if (!p)
return NULL;
+ memset(p, 0, PAGE_SIZE);
pmd_populate_kernel(&init_mm, pmd, p);
}
return pmd;
@@ -203,6 +204,7 @@ pud_t * __meminit vmemmap_pud_populate(p4d_t *p4d, unsigned long addr, int node)
void *p = vmemmap_alloc_block(PAGE_SIZE, node);
if (!p)
return NULL;
+ memset(p, 0, PAGE_SIZE);
pud_populate(&init_mm, pud, p);
}
return pud;
@@ -215,6 +217,7 @@ p4d_t * __meminit vmemmap_p4d_populate(pgd_t *pgd, unsigned long addr, int node)
void *p = vmemmap_alloc_block(PAGE_SIZE, node);
if (!p)
return NULL;
+ memset(p, 0, PAGE_SIZE);
p4d_populate(&init_mm, p4d, p);
}
return p4d;
@@ -227,6 +230,7 @@ pgd_t * __meminit vmemmap_pgd_populate(unsigned long addr, int node)
void *p = vmemmap_alloc_block(PAGE_SIZE, node);
if (!p)
return NULL;
+ memset(p, 0, PAGE_SIZE);
pgd_populate(&init_mm, pgd, p);
}
return pgd;
--
2.14.0
\
 
 \ /
  Last update: 2017-08-07 22:41    [W:0.447 / U:1.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site