Kirill A. Shutemov wrote: > Andrew Morton wrote: > > On Fri, 27 Sep 2013 16:16:26 +0300 "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx> wrote: > > > > > 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. > > > > spinlock_t is rather large when lockdep is enabled. What happens? > > The same as with PTE split lock: CONFIG_SPLIT_PTLOCK_CPUS set to 999999 > if DEBUG_SPINLOCK || DEBUG_LOCK_ALLOC. It effectively blocks split locks > usage if spinlock_t is too big. Hm. It seems CONFIG_GENERIC_LOCKBREAK on 32bit systems is a problem too: it makes sizeof(spinlock_t) 8 bythes and it increases sizeof(struct page) by 4 bytes. I don't think it's a good idea. Completely untested patch is below. >From 703603b2290e881b7477470eec43f85753caed13 Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx> Date: Fri, 4 Oct 2013 02:59:12 +0300 Subject: [PATCH] mm: avoid increase sizeof(struct page) due to split page table lock CONFIG_GENERIC_LOCKBREAK increases sizeof(spinlock_t) to 8 bytes. It leads to increase sizeof(struct page) by 4 bytes on 32-bit system if split page table lock is in use, since page->ptl shares space in union with longs and pointers. Let's disable split page table lock on 32-bit systems with GENERIC_LOCKBREAK enabled. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> --- mm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/Kconfig b/mm/Kconfig index 89d56e31f9..d19f7d380b 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -212,6 +212,7 @@ config SPLIT_PTLOCK_CPUS default "999999" if ARM && !CPU_CACHE_VIPT default "999999" if PARISC && !PA20 default "999999" if DEBUG_SPINLOCK || DEBUG_LOCK_ALLOC + default "999999" if !64BIT && GENERIC_LOCKBREAK default "4" config ARCH_ENABLE_SPLIT_PMD_PTLOCK -- Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>