All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: gnttab: don't use domain lock for serialization
@ 2012-10-16 14:38 tupeng212
  2012-10-16 14:49 ` Jan Beulich
  0 siblings, 1 reply; 2+ messages in thread
From: tupeng212 @ 2012-10-16 14:38 UTC (permalink / raw)
  To: Jan Beulich, Keir Fraser; +Cc: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 536 bytes --]

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?
Thanks a lot!




tupeng212

[-- Attachment #1.2: Type: text/html, Size: 2229 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gnttab: don't use domain lock for serialization
  2012-10-16 14:38 gnttab: don't use domain lock for serialization tupeng212
@ 2012-10-16 14:49 ` Jan Beulich
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2012-10-16 14:49 UTC (permalink / raw)
  To: tupeng212; +Cc: Keir Fraser, xen-devel

>>> On 16.10.12 at 16:38, tupeng212 <tupeng212@gmail.com> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-16 14:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-16 14:38 gnttab: don't use domain lock for serialization tupeng212
2012-10-16 14:49 ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.