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] Atomic operations

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Atomic operations
From: Juergen Gross <juergen.gross@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 26 Mar 2009 08:34:24 +0100
Cc: Timothy Hayes <hayesti@xxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 26 Mar 2009 00:34:52 -0700
Domainkey-signature: s=s768; d=fujitsu-siemens.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV: Received:Received:Message-ID:Date:From:Organization: User-Agent:MIME-Version:To:CC:Subject:References: In-Reply-To:X-Enigmail-Version:Content-Type: Content-Transfer-Encoding; b=YBky2KuNTNWgADxff6lXBfc/Tf03vRa4y8S6WYZqG6SBAzQFTTkK4VuM E07WtrdfodhHGnPkF4+oFSwGiOYsdUPfLzxnFc/lXQ36V+VYh2fbXpPY6 xeXH7t/O8yJn2qp;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C5F0DE54.4FA8%keir.fraser@xxxxxxxxxxxxx>
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>
Organization: Fujitsu Siemens Computers
References: <C5F0DE54.4FA8%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)
Keir Fraser wrote:
> The Linux atomic.h operations will be atomic even across domains.

... unless CONFIG_SMP was not defined in the domU kernel build.


Juergen

> On 26/03/2009 00:17, "Timothy Hayes" <hayesti@xxxxxx> wrote:
> 
>     I'm sure a lot of you know XenSocket (XVMSocket), if not, it's a
>     Loadable Kernel Module with a socket interface that sends/receives
>     to/from a shared page of memory mapped between two domains. It's
>     quite a nice idea and brings data throughput close to UNIX sockets.
>     I made some changes and made it compatible with Xen 3.2 and a newer
>     Linux kernel (I'm testing it with 2.6.25.20) however I'm noticing
>     some odd behaviour occasionally. In it, there are atomic_t variables
>     in a descriptor inside a shared memory page. When a domain sends or
>     receives from the socket, it will use one of the atomic_ operations
>     to update the amount of new data available. The problem I'm noticing
>     is that when two domains are concurrently updating this variable,
>     the value becomes inconsistent leading me to believe that the
>     atomic_ operations might not guarantee atomicity between domains. I
>     haven't been able to repeat any behaviour like this when I limit the
>     two guests to the same physical CPU and eliminate parallelism.
> 
>     Would anyone be able fill me in if I'm missing something? Are the
>     atomic_ operations 100% foolproof for this sort of thing? If not,
>     what would be the best approach to use instead?
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel


-- 
Juergen Gross                             Principal Developer
IP SW OS6                      Telephone: +49 (0) 89 636 47950
Fujitsu Siemens Computers         e-mail: juergen.gross@xxxxxxxxxxxxxxxxxxx
Otto-Hahn-Ring 6                Internet: www.fujitsu-siemens.com
D-81739 Muenchen         Company details: www.fujitsu-siemens.com/imprint.html

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

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