Skip to content

Commit

Permalink
x86/mm: Drop unused argument 'removed' from sync_global_pgds()
Browse files Browse the repository at this point in the history
Since commit af2cf27 ("x86/mm/hotplug: Don't remove PGD entries in
remove_pagetable()") there are no callers of sync_global_pgds() which set
the 'removed' argument to 1.

Remove the argument and the related conditionals in the function.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Link: http://lkml.kernel.org/r/20161214234403.137556-1-kirill.shutemov@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Kirill A. Shutemov authored and Thomas Gleixner committed Dec 15, 2016
1 parent aec03f8 commit 5372e15
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
3 changes: 1 addition & 2 deletions arch/x86/include/asm/pgtable_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ static inline void native_pgd_clear(pgd_t *pgd)
native_set_pgd(pgd, native_make_pgd(0));
}

extern void sync_global_pgds(unsigned long start, unsigned long end,
int removed);
extern void sync_global_pgds(unsigned long start, unsigned long end);

/*
* Conversion functions: convert a page and protection to a page entry,
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ static void dump_pagetable(unsigned long address)

void vmalloc_sync_all(void)
{
sync_global_pgds(VMALLOC_START & PGDIR_MASK, VMALLOC_END, 0);
sync_global_pgds(VMALLOC_START & PGDIR_MASK, VMALLOC_END);
}

/*
Expand Down
24 changes: 7 additions & 17 deletions arch/x86/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,18 @@ static int __init nonx32_setup(char *str)
__setup("noexec32=", nonx32_setup);

/*
* When memory was added/removed make sure all the processes MM have
* When memory was added make sure all the processes MM have
* suitable PGD entries in the local PGD level page.
*/
void sync_global_pgds(unsigned long start, unsigned long end, int removed)
void sync_global_pgds(unsigned long start, unsigned long end)
{
unsigned long address;

for (address = start; address <= end; address += PGDIR_SIZE) {
const pgd_t *pgd_ref = pgd_offset_k(address);
struct page *page;

/*
* When it is called after memory hot remove, pgd_none()
* returns true. In this case (removed == 1), we must clear
* the PGD entries in the local PGD level page.
*/
if (pgd_none(*pgd_ref) && !removed)
if (pgd_none(*pgd_ref))
continue;

spin_lock(&pgd_lock);
Expand All @@ -122,13 +117,8 @@ void sync_global_pgds(unsigned long start, unsigned long end, int removed)
BUG_ON(pgd_page_vaddr(*pgd)
!= pgd_page_vaddr(*pgd_ref));

if (removed) {
if (pgd_none(*pgd_ref) && !pgd_none(*pgd))
pgd_clear(pgd);
} else {
if (pgd_none(*pgd))
set_pgd(pgd, *pgd_ref);
}
if (pgd_none(*pgd))
set_pgd(pgd, *pgd_ref);

spin_unlock(pgt_lock);
}
Expand Down Expand Up @@ -596,7 +586,7 @@ kernel_physical_mapping_init(unsigned long paddr_start,
}

if (pgd_changed)
sync_global_pgds(vaddr_start, vaddr_end - 1, 0);
sync_global_pgds(vaddr_start, vaddr_end - 1);

__flush_tlb_all();

Expand Down Expand Up @@ -1239,7 +1229,7 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node)
} else
err = vmemmap_populate_basepages(start, end, node);
if (!err)
sync_global_pgds(start, end - 1, 0);
sync_global_pgds(start, end - 1);
return err;
}

Expand Down

0 comments on commit 5372e15

Please sign in to comment.