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

[Xen-devel] One shared memory read/write issue between 2 different domai

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] One shared memory read/write issue between 2 different domains
From: <chunjie_zhu@xxxxxxxxxxxxxxxxx>
Date: Wed, 25 May 2011 17:39:33 +0800
Cc: Jianxin_Guo@xxxxxxxxxxxxxxxxx
Delivery-date: Fri, 03 Jun 2011 09:50:47 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcwautPxA62h/2w4TRGNBnK99WaL/A==
Thread-topic: One shared memory read/write issue between 2 different domains

Dear xen-devel team,

 

Recently I encountered one technical issue on Xen platform. I want to request your help.

 

[Problem Description]

I code one ring buffer by myself for 2 domains to transmit data, one domain is producer, and the other is consumer. I do not use the ring buffer defined in “include/xen/interface/io/ring.h”. Just like the ring buffer provided by xen, I also use 2 pointers for producer and consumer, separately. To ensure memory access order is consistent, I use memory barrier between memory store/load operation and pointer update operation.

 

The transmitted data contains 2 parts, one is header, and the other is payload. Each time, one domain transmits the header first, and then the payload is sent out.

 

Each time I can get right header at the consumer side, however, sometimes, the data I get at the consumer side contains part of invalid information.

 

[Develop Environment]

Xen-4.0.1 + Linux-2.6.24-29-xen

 

Could you please give me some suggestion on this issue?

 

[Other Questions]

1.      Is it reasonable to use spin lock to protect shared memory between 2 different domains?

2.      Previously I use one atomic variable to do the synchronization between producer and consumer, however, sometimes I cannot get correct header at the consumer side. Is it one known-issue?

 

I am looking forward to your letters. Thanks in advance.

 

Regards,
Chunjie

============================================

 

阴风催急雨,木叶舞萧萧。

闲看天色变,忧心朋宾来。

 

TREND MICRO EMAIL NOTICE
The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>