Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-08 Thread Kirill A. Shutemov
On Fri, Nov 06, 2015 at 02:39:00PM -0800, Andrew Morton wrote: > On Fri, 6 Nov 2015 12:29:21 +0200 "Kirill A. Shutemov" > wrote: > > > > page_mapcount() is getting pretty bad too. > > > > Do you want me to uninline slow path (PageCompound())? > > I guess so. Uninlining all of page_mapcount()

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-08 Thread Kirill A. Shutemov
On Fri, Nov 06, 2015 at 02:39:00PM -0800, Andrew Morton wrote: > On Fri, 6 Nov 2015 12:29:21 +0200 "Kirill A. Shutemov" > wrote: > > > > page_mapcount() is getting pretty bad too. > > > > Do you want me to uninline slow path (PageCompound())? > > I guess so. Uninlining

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-06 Thread Andrew Morton
On Fri, 6 Nov 2015 12:29:21 +0200 "Kirill A. Shutemov" wrote: > > page_mapcount() is getting pretty bad too. > > Do you want me to uninline slow path (PageCompound())? I guess so. Uninlining all of page_mapcount() does this: gcc-4.4.4: textdata bss dec hex filename

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-06 Thread Kirill A. Shutemov
On Thu, Nov 05, 2015 at 04:32:11PM -0800, Andrew Morton wrote: > On Tue, 3 Nov 2015 17:26:15 +0200 "Kirill A. Shutemov" > wrote: > > > I've missed two simlar codepath which need some preparation to work well > > with reworked THP refcounting. > > > > Both page_referenced() and

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-06 Thread Andrew Morton
On Fri, 6 Nov 2015 12:29:21 +0200 "Kirill A. Shutemov" wrote: > > page_mapcount() is getting pretty bad too. > > Do you want me to uninline slow path (PageCompound())? I guess so. Uninlining all of page_mapcount() does this: gcc-4.4.4: textdata bss dec

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-06 Thread Kirill A. Shutemov
On Thu, Nov 05, 2015 at 04:32:11PM -0800, Andrew Morton wrote: > On Tue, 3 Nov 2015 17:26:15 +0200 "Kirill A. Shutemov" > wrote: > > > I've missed two simlar codepath which need some preparation to work well > > with reworked THP refcounting. > > > > Both

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Andrew Morton
On Tue, 3 Nov 2015 17:26:15 +0200 "Kirill A. Shutemov" wrote: > I've missed two simlar codepath which need some preparation to work well > with reworked THP refcounting. > > Both page_referenced() and page_idle_clear_pte_refs_one() assume that > THP can only be mapped with PMD, so there's no

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Kirill A. Shutemov
On Thu, Nov 05, 2015 at 07:03:24PM +0300, Vladimir Davydov wrote: > On Tue, Nov 03, 2015 at 05:26:15PM +0200, Kirill A. Shutemov wrote: > ... > > @@ -812,60 +812,104 @@ static int page_referenced_one(struct page *page, > > struct vm_area_struct *vma, > > spinlock_t *ptl; > > int

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Vladimir Davydov
On Thu, Nov 05, 2015 at 02:58:38PM +0200, Kirill A. Shutemov wrote: > Okay. Could you prepare the patch? OK, give me some time. Thanks, Vladimir -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Vladimir Davydov
On Tue, Nov 03, 2015 at 05:26:15PM +0200, Kirill A. Shutemov wrote: ... > @@ -812,60 +812,104 @@ static int page_referenced_one(struct page *page, > struct vm_area_struct *vma, > spinlock_t *ptl; > int referenced = 0; > struct page_referenced_arg *pra = arg; > + pgd_t *pgd;

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Kirill A. Shutemov
On Thu, Nov 05, 2015 at 03:53:54PM +0300, Vladimir Davydov wrote: > On Thu, Nov 05, 2015 at 02:36:06PM +0200, Kirill A. Shutemov wrote: > > On Thu, Nov 05, 2015 at 03:07:26PM +0300, Vladimir Davydov wrote: > > > @@ -849,30 +836,23 @@ static int page_referenced_one(struct page *page, > > > struct

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Vladimir Davydov
On Thu, Nov 05, 2015 at 02:36:06PM +0200, Kirill A. Shutemov wrote: > On Thu, Nov 05, 2015 at 03:07:26PM +0300, Vladimir Davydov wrote: > > @@ -849,30 +836,23 @@ static int page_referenced_one(struct page *page, > > struct vm_area_struct *vma, > > if (pmd_page(*pmd) != page) > >

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Kirill A. Shutemov
On Thu, Nov 05, 2015 at 03:07:26PM +0300, Vladimir Davydov wrote: > @@ -849,30 +836,23 @@ static int page_referenced_one(struct page *page, > struct vm_area_struct *vma, > if (pmd_page(*pmd) != page) > goto unlock_pmd; > > - if (vma->vm_flags &

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Vladimir Davydov
On Thu, Nov 05, 2015 at 11:24:59AM +0200, Kirill A. Shutemov wrote: > On Thu, Nov 05, 2015 at 12:10:13PM +0300, Vladimir Davydov wrote: > > On Tue, Nov 03, 2015 at 05:26:15PM +0200, Kirill A. Shutemov wrote: > > ... > > > @@ -56,23 +56,69 @@ static int page_idle_clear_pte_refs_one(struct page > >

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Kirill A. Shutemov
On Thu, Nov 05, 2015 at 12:10:13PM +0300, Vladimir Davydov wrote: > On Tue, Nov 03, 2015 at 05:26:15PM +0200, Kirill A. Shutemov wrote: > ... > > @@ -56,23 +56,69 @@ static int page_idle_clear_pte_refs_one(struct page > > *page, > > { > > struct mm_struct *mm = vma->vm_mm; > > spinlock_t

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Vladimir Davydov
On Tue, Nov 03, 2015 at 05:26:15PM +0200, Kirill A. Shutemov wrote: ... > @@ -56,23 +56,69 @@ static int page_idle_clear_pte_refs_one(struct page *page, > { > struct mm_struct *mm = vma->vm_mm; > spinlock_t *ptl; > + pgd_t *pgd; > + pud_t *pud; > pmd_t *pmd; >

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Vladimir Davydov
On Tue, Nov 03, 2015 at 05:26:15PM +0200, Kirill A. Shutemov wrote: ... > @@ -56,23 +56,69 @@ static int page_idle_clear_pte_refs_one(struct page *page, > { > struct mm_struct *mm = vma->vm_mm; > spinlock_t *ptl; > + pgd_t *pgd; > + pud_t *pud; > pmd_t *pmd; >

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Kirill A. Shutemov
On Thu, Nov 05, 2015 at 12:10:13PM +0300, Vladimir Davydov wrote: > On Tue, Nov 03, 2015 at 05:26:15PM +0200, Kirill A. Shutemov wrote: > ... > > @@ -56,23 +56,69 @@ static int page_idle_clear_pte_refs_one(struct page > > *page, > > { > > struct mm_struct *mm = vma->vm_mm; > > spinlock_t

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Kirill A. Shutemov
On Thu, Nov 05, 2015 at 03:07:26PM +0300, Vladimir Davydov wrote: > @@ -849,30 +836,23 @@ static int page_referenced_one(struct page *page, > struct vm_area_struct *vma, > if (pmd_page(*pmd) != page) > goto unlock_pmd; > > - if (vma->vm_flags &

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Kirill A. Shutemov
On Thu, Nov 05, 2015 at 03:53:54PM +0300, Vladimir Davydov wrote: > On Thu, Nov 05, 2015 at 02:36:06PM +0200, Kirill A. Shutemov wrote: > > On Thu, Nov 05, 2015 at 03:07:26PM +0300, Vladimir Davydov wrote: > > > @@ -849,30 +836,23 @@ static int page_referenced_one(struct page *page, > > > struct

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Vladimir Davydov
On Thu, Nov 05, 2015 at 02:36:06PM +0200, Kirill A. Shutemov wrote: > On Thu, Nov 05, 2015 at 03:07:26PM +0300, Vladimir Davydov wrote: > > @@ -849,30 +836,23 @@ static int page_referenced_one(struct page *page, > > struct vm_area_struct *vma, > > if (pmd_page(*pmd) != page) > >

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Vladimir Davydov
On Thu, Nov 05, 2015 at 11:24:59AM +0200, Kirill A. Shutemov wrote: > On Thu, Nov 05, 2015 at 12:10:13PM +0300, Vladimir Davydov wrote: > > On Tue, Nov 03, 2015 at 05:26:15PM +0200, Kirill A. Shutemov wrote: > > ... > > > @@ -56,23 +56,69 @@ static int page_idle_clear_pte_refs_one(struct page > >

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Kirill A. Shutemov
On Thu, Nov 05, 2015 at 07:03:24PM +0300, Vladimir Davydov wrote: > On Tue, Nov 03, 2015 at 05:26:15PM +0200, Kirill A. Shutemov wrote: > ... > > @@ -812,60 +812,104 @@ static int page_referenced_one(struct page *page, > > struct vm_area_struct *vma, > > spinlock_t *ptl; > > int

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Vladimir Davydov
On Thu, Nov 05, 2015 at 02:58:38PM +0200, Kirill A. Shutemov wrote: > Okay. Could you prepare the patch? OK, give me some time. Thanks, Vladimir -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Vladimir Davydov
On Tue, Nov 03, 2015 at 05:26:15PM +0200, Kirill A. Shutemov wrote: ... > @@ -812,60 +812,104 @@ static int page_referenced_one(struct page *page, > struct vm_area_struct *vma, > spinlock_t *ptl; > int referenced = 0; > struct page_referenced_arg *pra = arg; > + pgd_t *pgd;

Re: [PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-05 Thread Andrew Morton
On Tue, 3 Nov 2015 17:26:15 +0200 "Kirill A. Shutemov" wrote: > I've missed two simlar codepath which need some preparation to work well > with reworked THP refcounting. > > Both page_referenced() and page_idle_clear_pte_refs_one() assume that > THP can only

[PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-03 Thread Kirill A. Shutemov
I've missed two simlar codepath which need some preparation to work well with reworked THP refcounting. Both page_referenced() and page_idle_clear_pte_refs_one() assume that THP can only be mapped with PMD, so there's no reason to look on PTEs for PageTransHuge() pages. That's no true anymore:

[PATCH 4/4] mm: prepare page_referenced() and page_idle to new THP refcounting

2015-11-03 Thread Kirill A. Shutemov
I've missed two simlar codepath which need some preparation to work well with reworked THP refcounting. Both page_referenced() and page_idle_clear_pte_refs_one() assume that THP can only be mapped with PMD, so there's no reason to look on PTEs for PageTransHuge() pages. That's no true anymore: