From: Ian Jackson Subject: Re: [PATCH 10/11] mini-os/xenbus: Provide queue->wakeup hook Date: Mon, 30 Jun 2014 13:49:56 +0100 Message-ID: <21425.23796.574479.374529@mariner.uk.xensource.com> References: <1403291090-8657-1-git-send-email-ian.jackson@eu.citrix.com> <1403291090-8657-11-git-send-email-ian.jackson@eu.citrix.com> <20140626121810.GY6046@type.bordeaux.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X1b2T-0004Qc-19 for xen-devel@lists.xenproject.org; Mon, 30 Jun 2014 12:50:29 +0000 In-Reply-To: <20140626121810.GY6046@type.bordeaux.inria.fr> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Samuel Thibault Cc: xen-devel@lists.xenproject.org, Keir Fraser , Ian Campbell List-Id: xen-devel@lists.xenproject.org Samuel Thibault writes ("Re: [Xen-devel] [PATCH 10/11] mini-os/xenbus: Prov= ide queue->wakeup hook"): > Ian Jackson, le Fri 20 Jun 2014 20:04:49 +0100, a =E9crit : > > This allows xenbus's caller to get called back when an item is put on > > the queue, rather than simply having the waitq signaled. > = > Mmm, so the callback will be made with lock held, is that not a problem > in the use you plan? No. My callback function just needs to call a NetBSD kernel file descriptor poll() wakeup hook. > Although I don't usually like callbacks precisely for that kind of > reason, I'm not against it, but it should at least be documented. ... > > +/* > > + * Use of queue->wakeup: > > + * > > + * If queue->wakeup is set, it will be called instead of > > + * wake_up(&queue->waitq); > > + * > > + * queue->wakeup is initialised (to a function which just calls > > + * wake_up) by xenbus_event_queue_init. The user who wants something > > + * different should set ->wakeup after the init, but before the queue > > + * is used for xenbus_id_allocate or xenbus_watch_prepare. > > + * > > + * queue->wakeup() is called with the req_lock held. > > + */ Here it is :-). Thanks, Ian.