WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel][PATCH]improve suspend_evtchn lock processing

To: Chun Yan Liu <cyliu@xxxxxxxxxx>
Subject: Re: [Xen-devel][PATCH]improve suspend_evtchn lock processing
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Fri, 25 Feb 2011 17:09:09 +0000
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 25 Feb 2011 09:10:00 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4D641414020000660001D2AF@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4D641414020000660001D2AF@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Chun Yan Liu writes ("Re: [Xen-devel][PATCH]improve suspend_evtchn lock 
processing"):
> Hope there could be some hints. Thanks.

I think we should defer this patch to 4.2.  But here are some
comments in response to your questions:

> First, following is a change to use fcntl instead of flock (not
> available in newlibc when "make stubdom") and O_EXCL file, but the
> lock file could not be unlinked safely. There will be many lock
> files left in system.

The usual approach is to say that:
  * When locking you must
      open the file
      fstat
      fcntl F_SETLK[W]
      stat the file and check that the inode is the same
       as the one you have open; if not go back and try again
  * You may delete the lockfile if you have locked it first

> To use fcntl properly, the lock file should be created when VM
> started and deleted when VM destroyed. But I'm not sure if that
> change is acceptable or not. And I noticed in another patch, you
> mentioned fcntl (SETLK) is not very portable. Does that mean we'd
> better not use fcntl + SETLK to implement lock?

Perhaps this locking should be moved up into the toolstack, or done
via helper callbacks.

> Second, in the lastest code, the suspend_evtchn lock is set to each
> VM. Is there any user case that two processes contend for the
> suspend event channel of the same VM?

If they do then they will have to be serialised.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>