Re: [PATCH 8/9] mm: implement split page table lock for PMD level

2013-09-13 Thread Dave Hansen
On 09/13/2013 06:06 AM, Kirill A. Shutemov wrote: > +config ARCH_ENABLE_SPLIT_PMD_PTLOCK > + boolean > + > +config SPLIT_PMD_PTLOCK_CPUS > + int > + # hugetlb hasn't converted to split locking yet > + default "99" if HUGETLB_PAGE > + default "32" if ARCH_ENABLE_SPLIT_PMD_PTL

Re: [PATCH 8/9] mm: implement split page table lock for PMD level

2013-09-13 Thread Naoya Horiguchi
On Fri, Sep 13, 2013 at 04:06:15PM +0300, Kirill A. Shutemov wrote: > The basic idea is the same as with PTE level: the lock is embedded into > struct page of table's page. > > Split pmd page table lock only makes sense on big machines. > Let's say >= 32 CPUs for now. > > We can't use mm->pmd_hug

Re: [PATCH 8/9] mm: implement split page table lock for PMD level

2013-09-13 Thread Peter Zijlstra
On Fri, Sep 13, 2013 at 05:25:13PM +0300, Kirill A. Shutemov wrote: > Peter Zijlstra wrote: > > On Fri, Sep 13, 2013 at 04:06:15PM +0300, Kirill A. Shutemov wrote: > > > The basic idea is the same as with PTE level: the lock is embedded into > > > struct page of table's page. > > > > > > Split pmd

Re: [PATCH 8/9] mm: implement split page table lock for PMD level

2013-09-13 Thread Kirill A. Shutemov
Peter Zijlstra wrote: > On Fri, Sep 13, 2013 at 04:06:15PM +0300, Kirill A. Shutemov wrote: > > +#if USE_SPLIT_PMD_PTLOCKS > > + > > +static inline void pgtable_pmd_page_ctor(struct page *page) > > +{ > > + spin_lock_init(&page->ptl); > > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE > > + page->pmd_huge

Re: [PATCH 8/9] mm: implement split page table lock for PMD level

2013-09-13 Thread Kirill A. Shutemov
Peter Zijlstra wrote: > On Fri, Sep 13, 2013 at 04:06:15PM +0300, Kirill A. Shutemov wrote: > > The basic idea is the same as with PTE level: the lock is embedded into > > struct page of table's page. > > > > Split pmd page table lock only makes sense on big machines. > > Let's say >= 32 CPUs for

[PATCH 8/9] mm: implement split page table lock for PMD level

2013-09-13 Thread Kirill A. Shutemov
The basic idea is the same as with PTE level: the lock is embedded into struct page of table's page. Split pmd page table lock only makes sense on big machines. Let's say >= 32 CPUs for now. We can't use mm->pmd_huge_pte to store pgtables for THP, since we don't take mm->page_table_lock anymore.

Re: [PATCH 8/9] mm: implement split page table lock for PMD level

2013-09-13 Thread Peter Zijlstra
On Fri, Sep 13, 2013 at 04:06:15PM +0300, Kirill A. Shutemov wrote: > +#if USE_SPLIT_PMD_PTLOCKS > + > +static inline void pgtable_pmd_page_ctor(struct page *page) > +{ > + spin_lock_init(&page->ptl); > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE > + page->pmd_huge_pte = NULL; > +#endif > +} > + >

Re: [PATCH 8/9] mm: implement split page table lock for PMD level

2013-09-13 Thread Peter Zijlstra
On Fri, Sep 13, 2013 at 04:06:15PM +0300, Kirill A. Shutemov wrote: > The basic idea is the same as with PTE level: the lock is embedded into > struct page of table's page. > > Split pmd page table lock only makes sense on big machines. > Let's say >= 32 CPUs for now. Why is this? Couldn't I gene