Re: [Xen-devel] [PATCHv9 3/4] gnttab: make the grant table lock a read-write lock

2015-05-22 Thread David Vrabel
On 22/05/15 07:37, Jan Beulich wrote: On 21.05.15 at 17:16, wrote: >> On 21/05/15 15:53, Jan Beulich wrote: >> On 21.05.15 at 15:36, wrote: On 21/05/15 11:32, Jan Beulich wrote: On 20.05.15 at 17:54, wrote: >> @@ -827,9 +828,11 @@ __gnttab_map_grant_ref( >>

Re: [Xen-devel] [PATCHv9 3/4] gnttab: make the grant table lock a read-write lock

2015-05-21 Thread Jan Beulich
>>> On 21.05.15 at 17:16, wrote: > On 21/05/15 15:53, Jan Beulich wrote: > On 21.05.15 at 15:36, wrote: >>> On 21/05/15 11:32, Jan Beulich wrote: >>> On 20.05.15 at 17:54, wrote: > @@ -827,9 +828,11 @@ __gnttab_map_grant_ref( > if ( (wrc + rdc) == 0 ) >

Re: [Xen-devel] [PATCHv9 3/4] gnttab: make the grant table lock a read-write lock

2015-05-21 Thread David Vrabel
On 21/05/15 15:53, Jan Beulich wrote: On 21.05.15 at 15:36, wrote: >> On 21/05/15 11:32, Jan Beulich wrote: >> On 20.05.15 at 17:54, wrote: @@ -827,9 +828,11 @@ __gnttab_map_grant_ref( if ( (wrc + rdc) == 0 ) err = iommu_map_page(ld, frame, fr

Re: [Xen-devel] [PATCHv9 3/4] gnttab: make the grant table lock a read-write lock

2015-05-21 Thread Jan Beulich
>>> On 21.05.15 at 15:36, wrote: > On 21/05/15 11:32, Jan Beulich wrote: > On 20.05.15 at 17:54, wrote: >>> @@ -827,9 +828,11 @@ __gnttab_map_grant_ref( >>> if ( (wrc + rdc) == 0 ) >>> err = iommu_map_page(ld, frame, frame, IOMMUF_readable); >>> } >>> +

Re: [Xen-devel] [PATCHv9 3/4] gnttab: make the grant table lock a read-write lock

2015-05-21 Thread David Vrabel
On 21/05/15 14:36, David Vrabel wrote: > On 21/05/15 11:32, Jan Beulich wrote: > On 20.05.15 at 17:54, wrote: >>> @@ -842,8 +845,6 @@ __gnttab_map_grant_ref( >>> mt->ref = op->ref; >>> mt->flags = op->flags; >>> >>> -double_gt_unlock(lgt, rgt); >> >> Don't the mt-> updates ab

Re: [Xen-devel] [PATCHv9 3/4] gnttab: make the grant table lock a read-write lock

2015-05-21 Thread David Vrabel
On 21/05/15 11:32, Jan Beulich wrote: On 20.05.15 at 17:54, wrote: >> @@ -254,23 +254,23 @@ double_gt_lock(struct grant_table *lgt, struct >> grant_table *rgt) >> { >> if ( lgt < rgt ) >> { >> -spin_lock(&lgt->lock); >> -spin_lock(&rgt->lock); >> +write_loc

Re: [Xen-devel] [PATCHv9 3/4] gnttab: make the grant table lock a read-write lock

2015-05-21 Thread Jan Beulich
>>> On 20.05.15 at 17:54, wrote: > @@ -254,23 +254,23 @@ double_gt_lock(struct grant_table *lgt, struct > grant_table *rgt) > { > if ( lgt < rgt ) > { > -spin_lock(&lgt->lock); > -spin_lock(&rgt->lock); > +write_lock(&lgt->lock); > +write_lock(&rgt->lock

[Xen-devel] [PATCHv9 3/4] gnttab: make the grant table lock a read-write lock

2015-05-20 Thread David Vrabel
In combination with the per-active entry locks, the grant table lock can be made a read-write lock since the majority of cases only the read lock is required. The grant table read lock protects against changes to the table version or size (which are done with the write lock held). The write lock i