Skip to content

Commit

Permalink
[S390] sparsemem vmemmap: initialize memmap.
Browse files Browse the repository at this point in the history
Let's just use the generic vmmemmap_alloc_block() function which
always returns initialized memory.

Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed May 15, 2008
1 parent e0a45ee commit 2069e97
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions arch/s390/mm/vmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,40 +27,33 @@ struct memory_segment {

static LIST_HEAD(mem_segs);

static void __ref *vmem_alloc_pages(unsigned int order)
{
if (slab_is_available())
return (void *)__get_free_pages(GFP_KERNEL, order);
return alloc_bootmem_pages((1 << order) * PAGE_SIZE);
}

static inline pud_t *vmem_pud_alloc(void)
static pud_t *vmem_pud_alloc(void)
{
pud_t *pud = NULL;

#ifdef CONFIG_64BIT
pud = vmem_alloc_pages(2);
pud = vmemmap_alloc_block(PAGE_SIZE * 4, 0);
if (!pud)
return NULL;
clear_table((unsigned long *) pud, _REGION3_ENTRY_EMPTY, PAGE_SIZE * 4);
#endif
return pud;
}

static inline pmd_t *vmem_pmd_alloc(void)
static pmd_t *vmem_pmd_alloc(void)
{
pmd_t *pmd = NULL;

#ifdef CONFIG_64BIT
pmd = vmem_alloc_pages(2);
pmd = vmemmap_alloc_block(PAGE_SIZE * 4, 0);
if (!pmd)
return NULL;
clear_table((unsigned long *) pmd, _SEGMENT_ENTRY_EMPTY, PAGE_SIZE * 4);
#endif
return pmd;
}

static pte_t __init_refok *vmem_pte_alloc(void)
static pte_t __ref *vmem_pte_alloc(void)
{
pte_t *pte;

Expand Down Expand Up @@ -214,7 +207,7 @@ int __meminit vmemmap_populate(struct page *start, unsigned long nr, int node)
if (pte_none(*pt_dir)) {
unsigned long new_page;

new_page =__pa(vmem_alloc_pages(0));
new_page =__pa(vmemmap_alloc_block(PAGE_SIZE, 0));
if (!new_page)
goto out;
pte = pfn_pte(new_page >> PAGE_SHIFT, PAGE_KERNEL);
Expand Down

0 comments on commit 2069e97

Please sign in to comment.