History

mm: implement split page table lock for PMD level

The basic idea is the same as with PTE level: the lock is embedded into struct page of table's page. We can't use mm->pmd_huge_pte to store pgtables for THP, since we don't take mm->page_table_lock anymore. Let's reuse page->lru of table's page for that. pgtable_pmd_page_ctor() returns true, if initialization is successful and false otherwise. Current implementation never fails, but assumption that constructor can fail will help to port it to -rt where spinlock_t is rather huge and cannot be embedded into struct page -- dynamic allocation is required.

Kirill A. Shutemov committed 13 years ago

Commit e009bb31 parent c4088eb4 files · +43 −3Browse files

Showing the changes to kernel (1 of 4 files). Show all

Unified · Split

kernel/fork.c+2−2
@@ -560,7 +560,7 @@ static void check_mm(struct mm_struct *mm) · 559 unmodified lines
560 "mm:%p idx:%d val:%ld\n", mm, i, x);560 "mm:%p idx:%d val:%ld\n", mm, i, x);
561 }561 }
562 562
563#ifdef CONFIG_TRANSPARENT_HUGEPAGE563#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && !USE_SPLIT_PMD_PTLOCKS
564 VM_BUG_ON(mm->pmd_huge_pte);564 VM_BUG_ON(mm->pmd_huge_pte);
565#endif565#endif
566}566}
@@ -814,7 +814,7 @@ struct mm_struct *dup_mm(struct task_struct *tsk) · 247 unmodified lines
814 memcpy(mm, oldmm, sizeof(*mm));814 memcpy(mm, oldmm, sizeof(*mm));
815 mm_init_cpumask(mm);815 mm_init_cpumask(mm);
816 816
817#ifdef CONFIG_TRANSPARENT_HUGEPAGE817#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && !USE_SPLIT_PMD_PTLOCKS
818 mm->pmd_huge_pte = NULL;818 mm->pmd_huge_pte = NULL;
819#endif819#endif
820 if (!mm_init(mm, tsk))820 if (!mm_init(mm, tsk))