All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@gmail.com>
To: Milan Boberic <milanboberic94@gmail.com>
Cc: sstabellini@kernel.org, andrii_anisov@epam.com,
	Dario Faggioli <dfaggioli@suse.com>,
	julien.grall@arm.com, Meng Xu <xumengpanda@gmail.com>,
	xen-devel@lists.xenproject.org, stefano.stabellini@xilinx.com
Subject: Re: Xen optimization
Date: Fri, 12 Oct 2018 18:36:13 +0200	[thread overview]
Message-ID: <CAF3u54CBpZ5_B28RbohV0c8LfbOht59c6yhbY9jA-ARwyZEKMw@mail.gmail.com> (raw)
In-Reply-To: <CADJ6SV2v5=_MqfrABdfs1rcQ-BmCUJYyi_9fG8BC7C2vyxaqBA@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 6081 bytes --]

Hi,

Sorry for the formatting.

On Fri, 12 Oct 2018, 17:36 Milan Boberic, <milanboberic94@gmail.com> wrote:

> Hi Stefano, glad to have you back :D,
> this is my setup:
>         - dom0 is PetaLinux, has 1 vCPU and it's pinned for pCPU0
>         - there is only one domU and this is my bare-metal app that also
> have one vCPU and it's pinned for pCPU1
> so yeah, there is only dom0 and bare-metal app on the board.
>
> Jitter is the same with and without Dario's patch.
>
> I'm still not sure about timer's passthrough because there is no mention
> of triple timer counter is device tree so I added:
>
> &ttc0 {
>    xen,passthrough = <0x1>;
> };
>

Would you mind to explain what is the triple timer counter?



> at the end of the xen-overlay.dtsi file which I included in attachment.
>
> About patch you sent, I can't find this funcion void vgic_inject_irq in
> /xen/arch/arm/vgic.c file, this is link of git repository from where I
> build my xen so you can take a look if that printk can be put somewhere
> else.
>

There was some vGIC rework in Xen 4.11. There was also a new vGIC added
(selectable using NEW_VGIC). It might be worth to look at it.


> https://github.com/Xilinx/xen/
>

This is not the official Xen repository and look like patches have been
applied on top. I am afraid, I am not going to be able help here. Could you
do the same experiment with Xen 4.11?


>
> I ran some more testing and realized that results are the same with or
> without vwfi=native, which I think again points out that passthrough that I
> need to provide in device tree isn't valid.
>

This could also means that wfi is not used by the guest or you never go to
the idle vCPU.


>  And of course, higher the frequency of interrupts results in higher
> jitter. I'm still battling with Xilinx SDK and triple timer counter that's
> why I can't figure out what is the exact frequency set (I'm just rising it
> and lowering it), I'll give my best to solve that ASAP because we need to
> know exact value of frequency set.
>
> Thanks in advance!
>
> Milan
>
>
>
> On Fri, Oct 12, 2018 at 12:29 AM Stefano Stabellini <
> stefano.stabellini@xilinx.com> wrote:
>
>> On Thu, 11 Oct 2018, Milan Boberic wrote:
>> > On Wed, Oct 10, 2018 at 6:41 PM Meng Xu <xumengpanda@gmail.com> wrote:
>> > >
>> > > The jitter may come from Xen or the OS in dom0.
>> > > It will be useful to know what is the jitter if you run the test on
>> PetaLinux.
>> > > (It's understandable the jitter is gone without OS. It is also common
>> > > that OS introduces various interferences.)
>> >
>> > Hi Meng,
>> > well... I'm using bare-metal application and I need it exclusively to
>> > be ran on one CPU as domU (guest) without OS (and I'm not sure how
>> > would I make the same app to be ran on PetaLinux dom0 :D haha).
>> > Is there a chance that PetaLinux as dom0 is creating this jitter and
>> > how? Is there a way of decreasing it?
>> >
>> > Yes, there are no prints.
>> >
>> > I'm not sure about this timer interrupt passthrough because I didn't
>> > find any example of it, in attachment I included xen-overlay.dtsi file
>> > which I edited to add passthrough, in earlier replies there are
>> > bare-metal configuration file. It would be helpful to know if those
>> > setting are correct. If they are not correct it would explain the
>> > jitter.
>> >
>> > Thanks in advance, Milan Boberic!
>>
>> Hi Milan,
>>
>> Sorry for taking so long to go back to this thread. But I am here now :)
>>
>> First, let me ask a couple of questions to understand the scenario
>> better: is there any interference from other virtual machines while you
>> measure the jitter? Or is the baremetal app the only thing actively
>> running on the board?
>>
>> Second, it would be worth double-checking that Dario's patch to fix
>> sched=null is not having unexpected side effects. I don't think so, it
>> would be worth testing with it and without it to be sure.
>>
>> I gave a look at your VM configuration. The configuration looks correct.
>> There is no dtdev settings, but given that none of the devices you are
>> assigning to the guest does any DMA, it should be OK. You want to make
>> sure that Dom0 is not trying to use those same devices -- make sure to
>> add "xen,passthrough;" to each corresponding node on the host device
>> tree.
>>
>> The error messages "No valid vCPU found" are due to the baremetal
>> applications trying to configure as target cpu for the interrupt cpu1
>> (the second cpu in the system), while actually only 1 vcpu is assigned
>> to the VM. Hence, only cpu0 is allowed. I don't think it should cause
>> any jitter issues, because the request is simply ignored. Just to be
>> safe, you might want to double check that the physical interrupt is
>> delivered to the right physical cpu, which would be cpu1 in your
>> configuration, the one running the only vcpu of the baremetal app. You
>> can do that by adding a printk to xen/arch/arm/vgic.c:vgic_inject_irq,
>> for example:
>>
>> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
>> index 5a4f082..208fde7 100644
>> --- a/xen/arch/arm/vgic.c
>> +++ b/xen/arch/arm/vgic.c
>> @@ -591,6 +591,7 @@ void vgic_inject_irq(struct domain *d, struct vcpu
>> *v, unsigned int virq,
>>  out:
>>      spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
>>
>> +    if (v != current) printk("DEBUG irq slow path!\n");
>>      /* we have a new higher priority irq, inject it into the guest */
>>      vcpu_kick(v);
>>
>> You don't want "DEBUG irq slow path!" to get printed.
>>
>> Finally, I would try to set the timer to generate events less frequently
>> than every 1us and see what happens, maybe every 5-10us. In my tests,
>> the IRQ latency overhead caused by Xen is around 1us, so injecting 1
>> interrupt every 1us, plus 1us of latency caused by Xen, cannot lead to
>> good results.
>>
>> I hope this helps, please keep us updated with your results, they are
>> very interesting!
>>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xenproject.org
> https://lists.xenproject.org/mailman/listinfo/xen-devel

[-- Attachment #1.2: Type: text/html, Size: 8482 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-10-12 16:36 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-09 10:59 Xen optimization Milan Boberic
2018-10-09 16:46 ` Dario Faggioli
2018-10-10 11:22   ` Milan Boberic
2018-10-10 11:25     ` Milan Boberic
2018-10-10 16:41     ` Meng Xu
2018-10-11  7:36       ` Milan Boberic
2018-10-11 12:17         ` Milan Boberic
2018-10-11 17:05           ` Dario Faggioli
2018-10-11 15:39         ` Meng Xu
2018-10-11 22:29         ` Stefano Stabellini
2018-10-12 15:33           ` Milan Boberic
2018-10-12 16:36             ` Julien Grall [this message]
2018-10-12 17:43             ` Stefano Stabellini
2018-10-13 16:01               ` Milan Boberic
2018-10-14 22:46                 ` Stefano Stabellini
2018-10-15 12:27                   ` Milan Boberic
2018-10-16  7:13                     ` Stefano Stabellini
2018-10-15  8:14                 ` Julien Grall
2018-10-15 12:50                   ` Julien Grall
2018-10-15 13:01                     ` Milan Boberic
2018-10-15 13:03                       ` Julien Grall
2018-10-17 15:19                         ` Milan Boberic
2018-10-19 21:02                           ` Stefano Stabellini
2018-10-19 22:41                             ` Dario Faggioli
2018-10-22 15:02                               ` Milan Boberic
2018-10-22 17:52                                 ` Stefano Stabellini
2018-10-23  8:58                                   ` Milan Boberic
2018-10-24  0:24                                     ` Stefano Stabellini
2018-10-25 10:09                                       ` Milan Boberic
2018-10-25 11:30                                         ` Julien Grall
2018-10-25 12:36                                           ` Milan Boberic
2018-10-25 13:44                                             ` Dario Faggioli
2018-10-25 14:00                                               ` Julien Grall
2018-10-25 14:04                                             ` Julien Grall
2018-10-25 14:47                                               ` Milan Boberic
2018-10-25 14:51                                                 ` Julien Grall
2018-10-25 16:18                                                   ` Xen optimizationcy Stefano Stabellini
2018-10-25 11:09                                       ` Xen optimization Julien Grall
2018-10-25 16:15                                         ` Stefano Stabellini
2018-10-26 19:12                                           ` Julien Grall
2018-10-26 20:41                                             ` Stefano Stabellini
2018-10-29 12:29                                               ` Milan Boberic
2018-10-31 18:59                                                 ` Julien Grall
2018-10-31 20:35                                                   ` Milan Boberic
2018-10-31 21:16                                                     ` Julien Grall
2018-11-01 20:20                                                       ` Stefano Stabellini
2018-11-01 20:35                                                         ` Julien Grall
2018-11-20 11:33                                                         ` Andrii Anisov
2018-11-27 21:27                                                           ` Stefano Stabellini
2018-11-29  8:19                                                             ` Andrii Anisov
2018-12-10 10:58                                                             ` Andrii Anisov
2018-12-10 11:54                                                               ` Julien Grall
2018-12-10 12:23                                                                 ` Andrii Anisov
2018-12-11 12:27                                                                   ` Julien Grall
2018-12-11 16:56                                                                     ` Dario Faggioli
2018-12-12  9:39                                                                       ` Andrii Anisov
2018-12-12 17:10                                                                         ` Dario Faggioli
2018-12-12 17:32                                                                           ` Andrii Anisov
2018-12-12 17:59                                                                             ` Dario Faggioli
2018-12-13  7:48                                                                               ` Andrii Anisov
2018-12-11 18:39                                                                     ` Stefano Stabellini
2018-12-11 19:05                                                                       ` Julien Grall
2018-12-11 19:29                                                                         ` Stefano Stabellini
2018-12-12  9:46                                                                           ` Andrii Anisov
2018-12-12 10:41                                                                             ` Andrii Anisov
2018-12-12 17:39                                                                               ` Stefano Stabellini
2018-12-12 17:47                                                                                 ` Andrii Anisov
2018-12-12 18:01                                                                                   ` Stefano Stabellini
2018-12-12  9:34                                                                     ` Andrii Anisov
2018-11-07 13:14   ` Julien Grall

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=CAF3u54CBpZ5_B28RbohV0c8LfbOht59c6yhbY9jA-ARwyZEKMw@mail.gmail.com \
    --to=julien.grall@gmail.com \
    --cc=andrii_anisov@epam.com \
    --cc=dfaggioli@suse.com \
    --cc=julien.grall@arm.com \
    --cc=milanboberic94@gmail.com \
    --cc=sstabellini@kernel.org \
    --cc=stefano.stabellini@xilinx.com \
    --cc=xen-devel@lists.xenproject.org \
    --cc=xumengpanda@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.