From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH (V9) 2/2] xen: Add V4V implementation Date: Mon, 10 Jun 2013 16:06:13 +0100 Message-ID: <51B5EB65.4070703@citrix.com> References: <1369770211-4509-1-git-send-email-ross.philipson@citrix.com> <1369770211-4509-3-git-send-email-ross.philipson@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1369770211-4509-3-git-send-email-ross.philipson@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ross Philipson Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 28/05/13 20:43, Ross Philipson wrote: > Setup of v4v domains a domain gets created and cleanup > when a domain die. Wire up the v4v hypercall. [...] > +static void > +v4v_pending_notify(struct domain *caller_d, struct hlist_head *to_notify) > +{ > + struct hlist_node *node, *next; > + struct v4v_pending_ent *pending_ent; > + > + ASSERT(rw_is_locked(&v4v_lock)); > + > + hlist_for_each_entry_safe(pending_ent, node, next, to_notify, node) > + { > + hlist_del(&pending_ent->node); > + v4v_signal_domid(pending_ent->id); > + xfree(pending_ent); > + } > + > +} > + > +static void > +v4v_pending_find(struct domain *d, struct v4v_ring_info *ring_info, > + uint32_t payload_space, struct hlist_head *to_notify) > +{ > + struct hlist_node *node, *next; > + struct v4v_pending_ent *ent; > + > + ASSERT(rw_is_locked(&d->v4v->lock)); > + > + spin_lock(&ring_info->lock); > + hlist_for_each_entry_safe(ent, node, next, &ring_info->pending, node) > + { > + if ( payload_space >= ent->len ) > + { > + hlist_del(&ent->node); > + hlist_add_head(&ent->node, to_notify); > + } > + } > + spin_unlock(&ring_info->lock); > +} This "space in destination ring" notification does not seem like it would scale very well for: a) many senders into the same ring; or b) a single sender to many (full) rings. In (a), all domains are notified, even though only one will win the race and put a message on the ring. In (b) the guest must retry all pending transmits as it doesn't know which destination ring now has space. David