Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756647Ab3IFRQB (ORCPT ); Fri, 6 Sep 2013 13:16:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25500 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752739Ab3IFRP7 (ORCPT ); Fri, 6 Sep 2013 13:15:59 -0400 Date: Fri, 06 Sep 2013 13:15:28 -0400 From: Naoya Horiguchi To: "Kirill A. Shutemov" Cc: linux-mm@kvack.org, Andrew Morton , Mel Gorman , Andi Kleen , Michal Hocko , KOSAKI Motohiro , Rik van Riel , Andrea Arcangeli , "Aneesh Kumar K.V" , Alex Thorlton , linux-kernel@vger.kernel.org Message-ID: <1378487728-70p8rvt-mutt-n-horiguchi@ah.jp.nec.com> In-Reply-To: <20130906164625.353B1E0090@blue.fi.intel.com> References: <1378416466-30913-1-git-send-email-n-horiguchi@ah.jp.nec.com> <1378416466-30913-3-git-send-email-n-horiguchi@ah.jp.nec.com> <20130906104803.0F39CE0090@blue.fi.intel.com> <1378484835-8552fpnd-mutt-n-horiguchi@ah.jp.nec.com> <20130906164625.353B1E0090@blue.fi.intel.com> Subject: Re: [PATCH 2/2] thp: support split page table lock Mime-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Mutt-References: <20130906164625.353B1E0090@blue.fi.intel.com> X-Mutt-Fcc: ~/Maildir/sent/ User-Agent: Mutt 1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2310 Lines: 51 On Fri, Sep 06, 2013 at 07:46:25PM +0300, Kirill A. Shutemov wrote: > Naoya Horiguchi wrote: > > Hi Kirill, > > > > On Fri, Sep 06, 2013 at 01:48:03PM +0300, Kirill A. Shutemov wrote: > > > Naoya Horiguchi wrote: > > > > Thp related code also uses per process mm->page_table_lock now. > > > > So making it fine-grained can provide better performance. > > > > > > > > This patch makes thp support split page table lock by using page->ptl > > > > of the pages storing "pmd_trans_huge" pmds. > > > > > > > > Some functions like pmd_trans_huge_lock() and page_check_address_pmd() > > > > are expected by their caller to pass back the pointer of ptl, so this > > > > patch adds to those functions new arguments for that. Rather than that, > > > > this patch gives only straightforward replacement. > > > > > > > > ChangeLog v3: > > > > - fixed argument of huge_pmd_lockptr() in copy_huge_pmd() > > > > - added missing declaration of ptl in do_huge_pmd_anonymous_page() > > > > > > > > Signed-off-by: Naoya Horiguchi > > > > > > Generally, looks good. Few notes: > > > > > > I believe you need to convert __pte_alloc() to new locking. Not sure about > > > __pte_alloc_kernel(). > > > Have you check all rest mm->page_table_lock, that they shouldn't be > > > converted to new locking? > > > > I thought that keeping __pte_alloc() using mm->page_table_lock was safe > > because it uses bare mm->page_table_lock instead of pte_lockptr() even > > before this patchset, but not 100% sure. > > __pte_alloc() (and its family) are used in normal page path, so if it's > > not safe, we've lived with unsafe code for very long (maybe since 2005). > > Anyway, converting __pte_alloc() into split ptl could improve performance > > (though we need testing to know what amount), so I'll try that. > > No, before the patch mm->page_table_lock is what we need: it serializes > setting up pmd, not adding pte to pmd and it's subject to change with new > locking model. OK, I see. This is a todo for the next post. Thank you for explanation. Naoya -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/