From mboxrd@z Thu Jan 1 00:00:00 1970 From: tupeng212 Subject: Re: gnttab: don't use domain lock for serialization Date: Tue, 16 Oct 2012 22:38:17 +0800 Message-ID: <201210162238055789394@gmail.com> Reply-To: tupeng212 Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8103105338649812131==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , Keir Fraser Cc: xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --===============8103105338649812131== Content-Type: multipart/alternative; boundary="----=_001_NextPart682606167853_=----" This is a multi-part message in MIME format. ------=_001_NextPart682606167853_=---- Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 eGVuL2NvbW1vbi9ncmFudF90YWJsZS5jIA0KMTc0IHN0YXRpYyBpbmxpbmUgdm9pZCANCjE3NSBk b3VibGVfZ3RfbG9jayhzdHJ1Y3QgZ3JhbnRfdGFibGUgKmxndCwgc3RydWN0IGdyYW50X3RhYmxl ICpyZ3QpIA0KMTc2IHsgDQoxNzcgaWYgKCBsZ3QgPCByZ3QgKSANCjE3OCB7IA0KMTc5IHNwaW5f bG9jaygmbGd0LT5sb2NrKTsgDQoxODAgc3Bpbl9sb2NrKCZyZ3QtPmxvY2spOyANCjE4MSB9IA0K MTgyIGVsc2UgDQoxODMgeyANCjE4NCBpZiAoIGxndCAhPSByZ3QgKSANCjE4NSAgICAgc3Bpbl9s b2NrKCZyZ3QtPmxvY2spOyANCjE4NiBzcGluX2xvY2soJmxndC0+bG9jayk7IC8vaGVyZSBpZiB0 aGUgc2FtZSwgd2UganVzdCBsb2NrIG9uY2UuDQoxODcgfSANCjE4OCB9DQoNCkkgaGF2ZSBhIHF1 ZXN0aW9uLCB3aGVuIGxndCA9PSByZ3QgPyANCnJlbW90ZSBkb21haW4ncyBncmFudF90YWJsZSBp cyBjcmVhdGVkIGJ5IGl0c2VsZiwgc28gaG93IHRoZXkgZ2V0IHRoZSBzYW1lPw0KVGhhbmtzIGEg bG90IQ0KDQoNCg0KDQp0dXBlbmcyMTI= ------=_001_NextPart682606167853_=---- Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
xen/common/grant_table.c
174 static inline void 
175 double_gt_lock(struct grant_table *lgt, struc= t 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 !=3D rgt ) 
185     spin_lock(&rgt->lock); <= /DIV>
186 spin_lock(&lgt->lock); //here if the same, we ju= st=20 lock once.
187 } 
188 }
 
I have a question, when lgt =3D=3D rgt ?
remote domain's grant_table is created by itself, so how they get the= same?
Thanks a lot!
 

tupeng212
------=_001_NextPart682606167853_=------ --===============8103105338649812131== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============8103105338649812131==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: gnttab: don't use domain lock for serialization Date: Tue, 16 Oct 2012 15:49:58 +0100 Message-ID: <507D903602000078000A1B8B@nat28.tlf.novell.com> References: <201210162238055789394@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <201210162238055789394@gmail.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: tupeng212 Cc: Keir Fraser , xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 16.10.12 at 16:38, tupeng212 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