From: Ian Campbell <ian.campbell@citrix.com>
To: Julien Grall <julien.grall@citrix.com>
Cc: Vijay Kilari <vijay.kilari@gmail.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Prasun Kapoor <Prasun.Kapoor@caviumnetworks.com>,
manish.jaggi@caviumnetworks.com,
Julien Grall <julien.grall@linaro.org>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
Stefano Stabellini <stefano.stabellini@citrix.com>
Subject: Re: Xen on ARM vITS Handling Draft B (Was Re: Xen/arm: Virtual ITS command queue handling)
Date: Tue, 19 May 2015 13:10:07 +0100 [thread overview]
Message-ID: <1432037407.12989.103.camel@citrix.com> (raw)
In-Reply-To: <555608C6.7000609@citrix.com>
On Fri, 2015-05-15 at 15:55 +0100, Julien Grall wrote:
[...]
> > Translation of certain commands can be expensive (XXX citation
> > needed).
>
> The term "expensive" is subjective. I think we can end up to cheap
> translation if we properly pre-allocate information (such as device,
> LPIs...). We can have all the informations before the guest as boot or
> during hotplug part. It wouldn't take more memory than it should use.
>
> During command translation, we would just need to enable the device/LPIs.
>
> The remaining expensive part would be the validation. I think we can
> improve most of them of O(1) (such as collection checking) or O(log(n))
> (such as device checking).
[...]
> > XXX need a solution for this.
>
> Command translation can be improved. It may be good too add a section
> explaining how translation of command foo can be done.
I think that is covered by the spec, however if there are operations
which form part of this which are potentially expensive we should
outline in our design how this will be dealt with.
Perhaps you or Vijay could propose some additional text covering:
* What the potentially expensive operations during a translation
are.
* How we are going to deal with those operations, including:
* What data structure is used
* What start of day setup is required to enable this
* What operations are therefore required at translation
time
> > ### Filling the pITS Command Queue.
> >
> > Various algorithms could be used here. For now a simple proposal is
> > to traverse the `pits.schedule_list` starting from where the last
> > refill finished (i.e not from the top of the list each time).
> >
> > If a `vits_cq` has no pending commands then it is removed from the
> > list.
> >
> > If a `vits_cq` has some pending commands then `min(pits-free-slots,
> > vits-outstanding, VITS_BATCH_SIZE)` will be taken from the vITS
> > command queue, translated and placed onto the pITS
> > queue. `vits_cq.progress` will be updated to reflect this.
> >
> > Each `vits_cq` is handled in turn in this way until the pITS Command
> > Queue is full or there are no more outstanding commands.
> >
> > There will likely need to be a data structure which shadows the pITS
> > Command Queue slots with references to the `vits_cq` which has a
> > command currently occupying that slot and corresponding the index into
> > the virtual command queue, for use when completing a command.
> >
> > `VITS_BATCH_SIZE` should be small, TBD say 4 or 8.
> >
> > Possible simplification: If we arrange that no guest ever has multiple
> > batches in flight (which can occur if we wrap around the list several
> > times) then we may be able to simplify the book keeping
> > required. However this may need some careful thought wrt fairness for
> > guests submitting frequent small batches of commands vs those sending
> > large batches.
> >
> > XXX concern: Time spent filling the pITS queue could be significant if
> > guests are allowed to fill the ring completely.
>
> I guess you sent this design before the end of the discussion?
Probably.
> I think
> that limiting the number of batch/command sent per pass would allow a
> small pass.
I think we have a few choices:
* Limit to one batch per vits at a time
* Limit to some total number of batches per scheduling pass
* Time bound the scheduling procedure
Do we have a preference?
> > the underlying hardware to the guest.
> > * Adds complexity to the guest layout, which is right now static. How
> > do you decide the number of vITS/root controller exposed:
> > * Hotplug is tricky
> > * Toolstack needs greater knowledge of the host layout
> > * Given that PCI passthrough doesn't allow migration, maybe we could
> > use the layout of the hardware.
> >
> > In 1 vITS for all pITS:
> >
> > * What to do with global commands? Inject to all pITS and then
> > synchronise on them all finishing.
> > * Handling of out of order completion of commands queued with
> > different pITS, since the vITS must appear to complete in
> > order. Apart from the book keeping question it makes scheduling more
> > interesting:
> > * What if you have a pITS with slots available, and the guest command
> > queue contains commands which could go to the pITS, but behind ones
> > which are targetting another pITS which has no slots
> > * What if one pITS is very busy and another is mostly idle and a
> > guest submits one command to the busy one (contending with other
> > guest) followed by a load of commands targeting the idle one. Those
> > commands would be held up in this situation.
> > * Reasoning about fairness may be harder.
> >
> > XXX need a solution/decision here.
>
> > In addition the introduction of direct interrupt injection in version
> > 4 GICs may imply a vITS per pITS. (Update: it seems not)
>
> Other items to add: NUMA and I/O NUMA. I don't know much about it but I
> think the first solution would be more suitable.
first solution == ?
Ian.
next prev parent reply other threads:[~2015-05-19 12:10 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-05 12:14 Xen/arm: Virtual ITS command queue handling Vijay Kilari
2015-05-05 13:51 ` Stefano Stabellini
2015-05-05 13:54 ` Julien Grall
2015-05-05 15:56 ` Vijay Kilari
2015-05-05 14:09 ` Julien Grall
2015-05-05 16:09 ` Vijay Kilari
2015-05-05 16:27 ` Julien Grall
2015-05-12 15:02 ` Ian Campbell
2015-05-12 17:35 ` Julien Grall
2015-05-13 13:23 ` Ian Campbell
2015-05-13 14:26 ` Julien Grall
2015-05-15 10:59 ` Ian Campbell
2015-05-15 11:26 ` Vijay Kilari
2015-05-15 11:30 ` Ian Campbell
2015-05-15 12:03 ` Julien Grall
2015-05-15 12:47 ` Vijay Kilari
2015-05-15 12:52 ` Julien Grall
2015-05-15 12:53 ` Ian Campbell
2015-05-15 13:14 ` Vijay Kilari
2015-05-15 13:24 ` Ian Campbell
2015-05-15 13:44 ` Julien Grall
2015-05-15 14:04 ` Vijay Kilari
2015-05-15 15:05 ` Julien Grall
2015-05-15 15:38 ` Ian Campbell
2015-05-15 17:31 ` Julien Grall
2015-05-16 4:03 ` Vijay Kilari
2015-05-16 8:49 ` Julien Grall
2015-05-19 11:38 ` Vijay Kilari
2015-05-19 11:48 ` Ian Campbell
2015-05-19 11:55 ` Ian Campbell
2015-05-19 12:10 ` Vijay Kilari
2015-05-19 12:19 ` Ian Campbell
2015-05-19 12:48 ` Vijay Kilari
2015-05-19 13:12 ` Ian Campbell
2015-05-19 14:05 ` Julien Grall
2015-05-19 14:48 ` Ian Campbell
2015-05-19 15:44 ` Julien Grall
2015-05-15 14:05 ` Ian Campbell
2015-05-15 12:19 ` Julien Grall
2015-05-15 12:58 ` Ian Campbell
2015-05-15 13:24 ` Julien Grall
2015-05-19 12:14 ` Ian Campbell
2015-05-19 13:27 ` Julien Grall
2015-05-19 13:36 ` Ian Campbell
2015-05-19 13:46 ` Julien Grall
2015-05-19 13:54 ` Ian Campbell
2015-05-19 14:04 ` Vijay Kilari
2015-05-19 14:18 ` Ian Campbell
2015-05-21 12:37 ` Manish Jaggi
2015-05-26 13:04 ` Ian Campbell
2015-06-01 22:57 ` Manish Jaggi
2015-06-02 8:29 ` Ian Campbell
2015-05-19 14:06 ` Julien Grall
2015-05-13 16:27 ` Vijay Kilari
2015-05-15 11:28 ` Ian Campbell
2015-05-15 12:38 ` Vijay Kilari
2015-05-15 13:06 ` Ian Campbell
2015-05-15 13:17 ` Julien Grall
2015-05-15 11:45 ` Xen on ARM vITS Handling Draft B (Was Re: Xen/arm: Virtual ITS command queue handling) Ian Campbell
2015-05-15 14:55 ` Julien Grall
2015-05-19 12:10 ` Ian Campbell [this message]
2015-05-19 13:37 ` Julien Grall
2015-05-19 13:51 ` Ian Campbell
2015-05-22 12:16 ` Vijay Kilari
2015-05-22 12:49 ` Julien Grall
2015-05-22 13:58 ` Vijay Kilari
2015-05-22 14:35 ` Julien Grall
2015-05-22 14:54 ` Vijay Kilari
2015-05-24 10:35 ` Julien Grall
2015-05-25 9:06 ` Vijay Kilari
2015-05-25 9:32 ` Julien Grall
2015-05-25 10:40 ` Vijay Kilari
2015-05-25 12:44 ` Julien Grall
2015-05-25 13:38 ` Vijay Kilari
2015-05-25 17:11 ` Julien Grall
2015-05-27 11:22 ` Ian Campbell
2015-05-27 11:22 ` Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1432037407.12989.103.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=Prasun.Kapoor@caviumnetworks.com \
--cc=julien.grall@citrix.com \
--cc=julien.grall@linaro.org \
--cc=manish.jaggi@caviumnetworks.com \
--cc=stefano.stabellini@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=vijay.kilari@gmail.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).