[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] gnttab: don't use domain lock for serialization



>>> On 16.10.12 at 16:38, tupeng212 <tupeng212@xxxxxxxxx> wrote:
> xen/common/grant_table.c 
> 174 static inline void 
> 175 double_gt_lock(struct grant_table *lgt, struct grant_table *rgt) 
> 176 { 
> 177 if ( lgt < rgt ) 
> 178 { 
> 179 spin_lock(&lgt->lock); 
> 180 spin_lock(&rgt->lock); 
> 181 } 
> 182 else 
> 183 { 
> 184 if ( lgt != rgt ) 
> 185     spin_lock(&rgt->lock); 
> 186 spin_lock(&lgt->lock); //here if the same, we just lock once.
> 187 } 
> 188 }
> 
> I have a question, when lgt == rgt ? 
> remote domain's grant_table is created by itself, so how they get the same?

If backend and frontend are in the same domain (e.g. vbd
attached locally to Dom0), both domains (and hence both grant
tables) involved are the same.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.