Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332381
b: refs/heads/master
c: 274023d
h: refs/heads/master
i:
  332379: cd13d7b
v: v3
  • Loading branch information
Gerald Schaefer authored and Linus Torvalds committed Oct 9, 2012
1 parent bb9eef3 commit e85ac0e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9501d09fa3c4ca18971083dfb0c9aa1afc85f19c
refs/heads/master: 274023da1e8a49efa6fd9bf857f8557e5db44cdf
30 changes: 30 additions & 0 deletions trunk/arch/s390/mm/pgtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,30 @@ void tlb_remove_table(struct mmu_gather *tlb, void *table)
tlb_table_flush(tlb);
}

#ifdef CONFIG_TRANSPARENT_HUGEPAGE
void thp_split_vma(struct vm_area_struct *vma)
{
unsigned long addr;
struct page *page;

for (addr = vma->vm_start; addr < vma->vm_end; addr += PAGE_SIZE) {
page = follow_page(vma, addr, FOLL_SPLIT);
}
}

void thp_split_mm(struct mm_struct *mm)
{
struct vm_area_struct *vma = mm->mmap;

while (vma != NULL) {
thp_split_vma(vma);
vma->vm_flags &= ~VM_HUGEPAGE;
vma->vm_flags |= VM_NOHUGEPAGE;
vma = vma->vm_next;
}
}
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */

/*
* switch on pgstes for its userspace process (for kvm)
*/
Expand Down Expand Up @@ -824,6 +848,12 @@ int s390_enable_sie(void)
if (!mm)
return -ENOMEM;

#ifdef CONFIG_TRANSPARENT_HUGEPAGE
/* split thp mappings and disable thp for future mappings */
thp_split_mm(mm);
mm->def_flags |= VM_NOHUGEPAGE;
#endif

/* Now lets check again if something happened */
task_lock(tsk);
if (!tsk->mm || atomic_read(&tsk->mm->mm_users) > 1 ||
Expand Down

0 comments on commit e85ac0e

Please sign in to comment.