s390/vmemmap: remove memset call from vmemmap_populate()
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Sat, 20 Sep 2014 09:12:08 +0000 (11:12 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 25 Sep 2014 08:52:07 +0000 (10:52 +0200)
If the vmemmap array gets filled with large pages we allocate those
pages with vmemmap_alloc_block(), which returns cleared pages.
Only for single 4k pages we call our own vmem_alloc_pages() which does
not return cleared pages. However we can also call vmemmap_alloc_block()
to allocate the 4k pages.
This way we can also make sure the vmemmap array is cleared after its
population.
Therefore we can remove the memset at the end of the function which
would clear the vmmemmap array a second time on machines which do
support EDAT1.

On very large configurations this can save us several seconds.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/mm/vmem.c

index fe9012a49aa5abf0454bf4fa8f7d421c676ded26..121aff0a66b7bad4d968b2697a06259a6dfe8ebf 100644 (file)
@@ -253,9 +253,9 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node)
 
                pt_dir = pte_offset_kernel(pm_dir, address);
                if (pte_none(*pt_dir)) {
-                       unsigned long new_page;
+                       void *new_page;
 
-                       new_page =__pa(vmem_alloc_pages(0));
+                       new_page = vmemmap_alloc_block(PAGE_SIZE, node);
                        if (!new_page)
                                goto out;
                        pte_val(*pt_dir) =
@@ -263,7 +263,6 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node)
                }
                address += PAGE_SIZE;
        }
-       memset((void *)start, 0, end - start);
        ret = 0;
 out:
        return ret;