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] use xs_watch from userspace and use epoll instead of sel

To: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] use xs_watch from userspace and use epoll instead of select
From: Vasiliy G Tolstov <v.tolstov@xxxxxxxxx>
Date: Mon, 06 Jun 2011 12:58:29 +0400
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 06 Jun 2011 02:00:55 -0700
Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=selfip.ru; s=dk; h=Content-Transfer-Encoding:Mime-Version:Message-ID:Date:Content-Type:References:In-Reply-To:Cc:To:Reply-To:From:Subject; bh=NrJw2gxvBs9hrBtlEGKubLOgQmMv4WAstpl2bePMK84=; b=W9MOKrfKxOxgQHFFdHdnp1CLQSqQ7v+dwzb853ot8IH9Ric0oPcfjfhSVnscLr/x51lVUJm5lMX54YgY3As97EyXtdkkaUKjW70Y4M5FEjoiCmN5jI6sFWanzA/0sOcG;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1307349708.775.419.camel@xxxxxxxxxxxxxxxxxxxxxx>
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: Selfip.Ru
References: <1307102689.15777.3.camel@vase> <1307103239.775.382.camel@xxxxxxxxxxxxxxxxxxxxxx> <1307103479.15777.5.camel@vase> <1307117238.15777.7.camel@vase> <1307349708.775.419.camel@xxxxxxxxxxxxxxxxxxxxxx>
Reply-to: v.tolstov@xxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Mon, 2011-06-06 at 09:41 +0100, Ian Campbell wrote:
> On Fri, 2011-06-03 at 17:07 +0100, Vasiliy G Tolstov wrote:
> > On Fri, 2011-06-03 at 16:17 +0400, Vasiliy G Tolstov wrote:
> > > On Fri, 2011-06-03 at 13:13 +0100, Ian Campbell wrote:
> > > > On Fri, 2011-06-03 at 13:04 +0100, Vasiliy G Tolstov wrote:
> > > > > Hello. I have some examples of usage xs_watch in userspace that 
> > > > > contains
> > > > > loop with select function usage. If i use epoll, no events returned 
> > > > > from
> > > > > epoll_wait...
> > > > > Does it matter to use select from fd that used for watch?
> > > > > epoll fd added with ev.events = (EPOLLIN | EPOLLPRI | EPOLLONESHOT);
> > > > 
> > > > I think you need to provide an example of the code which doesn't work.
> > > > 
> > > > Ian.
> > > > 
> > > 
> > > This is not work:
> > >   if ((err = xs_watch(stats->xs, "data/xenmgm", "xenmgm")) != 0) {
> > 
> > Ok. I'm investigate, that xs_read can use relative to root path, for
> > example i can read domid not provide full path to it
> > (/local/domain/XX/domid), but if i want use watch, i need provide full
> > path to wathed node.... This is not clear to me after reading
> > examples... =)
> 
> Which xenstored implementation are you using? In general I would expect
> relative watches to work correctly. I looked briefly at the C xenstored
> and it appears to (at least be trying to) do the right thing here.
> 
> Are you running this code in dom0 or domU?
> 
> If it is domU which Xen release is libxenstore you are linking this code
> against against from? Which Xen release is your xenstored/dom0 running?
> 
> How are you opening your xenstore connection? i.e. which specific
> function call, xs_open, xs_daemon_open or xs_domain_open?
> 
> Did I understand correctly in your original message that basically the
> same code using select() works ok?
> 
> In another mail you wrote:
> > in stats_in_tfunc i'm use this, but looping2 never happening
> >  for (;;) {
> >     log_debug("%s", "looping1");
> >     if ((nr_events = epoll_wait(epfd, xen_events, 10, -1)) < 0) {
> >       log_error("%s", "failed epoll_wait");
> >       return NULL;
> >     }
> >     log_debug("%s", "looping1");
> > }
> 
> I guess this is a typo in the email rather than the actual code, but
> "looping2" never appears in this snippet -- you have "looping1" twice...
> 
> Ian.
> 

Code to using from domU. I'm correct all my mistakes and now relative
and full path watches work's fine with epoll and select based looping.
Sorry for wrong panic about it. 

Sorry for small offtop, where i can find example to use grand pages to
transfer for example 1byte from domU to dom) and vice versa?


-- 
Vasiliy G Tolstov <v.tolstov@xxxxxxxxx>
Selfip.Ru


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