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
560560 "mm:%p idx:%d val:%ld\n", mm, i, x);
561561 }
562562
563−#ifdef CONFIG_TRANSPARENT_HUGEPAGE
563+#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && !USE_SPLIT_PMD_PTLOCKS
564564 VM_BUG_ON(mm->pmd_huge_pte);
565565 #endif
566566 }
@@ -814,7 +814,7 @@ struct mm_struct *dup_mm(struct task_struct *tsk) · 247 unmodified lines
814814 memcpy(mm, oldmm, sizeof(*mm));
815815 mm_init_cpumask(mm);
816816
817−#ifdef CONFIG_TRANSPARENT_HUGEPAGE
817+#if defined(CONFIG_TRANSPARENT_HUGEPAGE) && !USE_SPLIT_PMD_PTLOCKS
818818 mm->pmd_huge_pte = NULL;
819819 #endif
820820 if (!mm_init(mm, tsk))