Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-18 Thread Joonsoo Kim
On Tue, Jul 16, 2013 at 08:01:46PM +1000, David Gibson wrote: > On Tue, Jul 16, 2013 at 02:34:24PM +0900, Joonsoo Kim wrote: > > On Mon, Jul 15, 2013 at 09:51:21PM -0400, Rik van Riel wrote: > > > On 07/15/2013 03:24 AM, David Gibson wrote: > > > >On Sun, Jul 14, 2013 at 08:16:44PM -0700,

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-18 Thread Joonsoo Kim
On Tue, Jul 16, 2013 at 08:01:46PM +1000, David Gibson wrote: On Tue, Jul 16, 2013 at 02:34:24PM +0900, Joonsoo Kim wrote: On Mon, Jul 15, 2013 at 09:51:21PM -0400, Rik van Riel wrote: On 07/15/2013 03:24 AM, David Gibson wrote: On Sun, Jul 14, 2013 at 08:16:44PM -0700, Davidlohr Bueso

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-16 Thread David Gibson
On Tue, Jul 16, 2013 at 02:34:24PM +0900, Joonsoo Kim wrote: > On Mon, Jul 15, 2013 at 09:51:21PM -0400, Rik van Riel wrote: > > On 07/15/2013 03:24 AM, David Gibson wrote: > > >On Sun, Jul 14, 2013 at 08:16:44PM -0700, Davidlohr Bueso wrote: > > > > >>>Reading the existing comment, this change

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-16 Thread David Gibson
On Mon, Jul 15, 2013 at 09:51:21PM -0400, Rik van Riel wrote: > On 07/15/2013 03:24 AM, David Gibson wrote: > >On Sun, Jul 14, 2013 at 08:16:44PM -0700, Davidlohr Bueso wrote: > > >>>Reading the existing comment, this change looks very suspicious to me. > >>>A per-vma mutex is just not going to

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-16 Thread David Gibson
On Mon, Jul 15, 2013 at 05:12:31PM -0700, Davidlohr Bueso wrote: > On Mon, 2013-07-15 at 16:08 -0700, Andrew Morton wrote: > > On Mon, 15 Jul 2013 17:24:32 +1000 David Gibson > > wrote: > > > > > I have previously proposed a correct method of improving scalability, > > > although it doesn't

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-16 Thread David Gibson
On Mon, Jul 15, 2013 at 05:12:31PM -0700, Davidlohr Bueso wrote: On Mon, 2013-07-15 at 16:08 -0700, Andrew Morton wrote: On Mon, 15 Jul 2013 17:24:32 +1000 David Gibson da...@gibson.dropbear.id.au wrote: I have previously proposed a correct method of improving scalability, although

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-16 Thread David Gibson
On Mon, Jul 15, 2013 at 09:51:21PM -0400, Rik van Riel wrote: On 07/15/2013 03:24 AM, David Gibson wrote: On Sun, Jul 14, 2013 at 08:16:44PM -0700, Davidlohr Bueso wrote: Reading the existing comment, this change looks very suspicious to me. A per-vma mutex is just not going to provide the

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-16 Thread David Gibson
On Tue, Jul 16, 2013 at 02:34:24PM +0900, Joonsoo Kim wrote: On Mon, Jul 15, 2013 at 09:51:21PM -0400, Rik van Riel wrote: On 07/15/2013 03:24 AM, David Gibson wrote: On Sun, Jul 14, 2013 at 08:16:44PM -0700, Davidlohr Bueso wrote: Reading the existing comment, this change looks very

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-15 Thread Joonsoo Kim
On Mon, Jul 15, 2013 at 09:51:21PM -0400, Rik van Riel wrote: > On 07/15/2013 03:24 AM, David Gibson wrote: > >On Sun, Jul 14, 2013 at 08:16:44PM -0700, Davidlohr Bueso wrote: > > >>>Reading the existing comment, this change looks very suspicious to me. > >>>A per-vma mutex is just not going to

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-15 Thread Rik van Riel
On 07/15/2013 03:24 AM, David Gibson wrote: On Sun, Jul 14, 2013 at 08:16:44PM -0700, Davidlohr Bueso wrote: Reading the existing comment, this change looks very suspicious to me. A per-vma mutex is just not going to provide the necessary exclusion, is it? (But I recall next to nothing about

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-15 Thread Davidlohr Bueso
On Mon, 2013-07-15 at 16:08 -0700, Andrew Morton wrote: > On Mon, 15 Jul 2013 17:24:32 +1000 David Gibson > wrote: > > > I have previously proposed a correct method of improving scalability, > > although it doesn't eliminate the lock. That's to use a set of hashed > > mutexes. > > Yep -

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-15 Thread Andrew Morton
On Mon, 15 Jul 2013 17:24:32 +1000 David Gibson wrote: > I have previously proposed a correct method of improving scalability, > although it doesn't eliminate the lock. That's to use a set of hashed > mutexes. Yep - hashing the mutexes is an obvious and nicely localized way of improving this.

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-15 Thread David Gibson
On Sun, Jul 14, 2013 at 08:16:44PM -0700, Davidlohr Bueso wrote: > On Fri, 2013-07-12 at 17:54 -0700, Hugh Dickins wrote: > > Adding the essential David Gibson to the Cc list. > > > > On Fri, 12 Jul 2013, Davidlohr Bueso wrote: > > > > > The hugetlb_instantiation_mutex serializes hugepage

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-15 Thread David Gibson
On Sun, Jul 14, 2013 at 08:16:44PM -0700, Davidlohr Bueso wrote: On Fri, 2013-07-12 at 17:54 -0700, Hugh Dickins wrote: Adding the essential David Gibson to the Cc list. On Fri, 12 Jul 2013, Davidlohr Bueso wrote: The hugetlb_instantiation_mutex serializes hugepage allocation and

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-15 Thread Andrew Morton
On Mon, 15 Jul 2013 17:24:32 +1000 David Gibson da...@gibson.dropbear.id.au wrote: I have previously proposed a correct method of improving scalability, although it doesn't eliminate the lock. That's to use a set of hashed mutexes. Yep - hashing the mutexes is an obvious and nicely

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-15 Thread Davidlohr Bueso
On Mon, 2013-07-15 at 16:08 -0700, Andrew Morton wrote: On Mon, 15 Jul 2013 17:24:32 +1000 David Gibson da...@gibson.dropbear.id.au wrote: I have previously proposed a correct method of improving scalability, although it doesn't eliminate the lock. That's to use a set of hashed

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-15 Thread Rik van Riel
On 07/15/2013 03:24 AM, David Gibson wrote: On Sun, Jul 14, 2013 at 08:16:44PM -0700, Davidlohr Bueso wrote: Reading the existing comment, this change looks very suspicious to me. A per-vma mutex is just not going to provide the necessary exclusion, is it? (But I recall next to nothing about

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-15 Thread Joonsoo Kim
On Mon, Jul 15, 2013 at 09:51:21PM -0400, Rik van Riel wrote: On 07/15/2013 03:24 AM, David Gibson wrote: On Sun, Jul 14, 2013 at 08:16:44PM -0700, Davidlohr Bueso wrote: Reading the existing comment, this change looks very suspicious to me. A per-vma mutex is just not going to provide the

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-14 Thread Konstantin Khlebnikov
This seems incorrect. hugetlb_instantiation_mutex protects chains of struct file_region in inode->i_mapping->private_list (VM_MAYSHARE) or vma_resv_map(vma)->regions (!VM_MAYSHARE) These chains obviously can be shared between several vmas, so per-vma lock cannot protect them. Davidlohr Bueso

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-14 Thread Davidlohr Bueso
On Fri, 2013-07-12 at 17:54 -0700, Hugh Dickins wrote: > Adding the essential David Gibson to the Cc list. > > On Fri, 12 Jul 2013, Davidlohr Bueso wrote: > > > The hugetlb_instantiation_mutex serializes hugepage allocation and > > instantiation > > in the page directory entry. It was found

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-14 Thread Davidlohr Bueso
On Fri, 2013-07-12 at 17:54 -0700, Hugh Dickins wrote: Adding the essential David Gibson to the Cc list. On Fri, 12 Jul 2013, Davidlohr Bueso wrote: The hugetlb_instantiation_mutex serializes hugepage allocation and instantiation in the page directory entry. It was found that this

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-14 Thread Konstantin Khlebnikov
This seems incorrect. hugetlb_instantiation_mutex protects chains of struct file_region in inode-i_mapping-private_list (VM_MAYSHARE) or vma_resv_map(vma)-regions (!VM_MAYSHARE) These chains obviously can be shared between several vmas, so per-vma lock cannot protect them. Davidlohr Bueso

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-12 Thread Hugh Dickins
Adding the essential David Gibson to the Cc list. On Fri, 12 Jul 2013, Davidlohr Bueso wrote: > The hugetlb_instantiation_mutex serializes hugepage allocation and > instantiation > in the page directory entry. It was found that this mutex can become quite > contended > during the early phases

Re: [PATCH] mm/hugetlb: per-vma instantiation mutexes

2013-07-12 Thread Hugh Dickins
Adding the essential David Gibson to the Cc list. On Fri, 12 Jul 2013, Davidlohr Bueso wrote: The hugetlb_instantiation_mutex serializes hugepage allocation and instantiation in the page directory entry. It was found that this mutex can become quite contended during the early phases of