2011-04-30 17:20:38

by Cyrill Gorcunov

[permalink] [raw]
Subject: [patch 0/2] x2apic optimization, round 4

Hi Ingo, here is an updated series of two patches for
x2apic cluster mode ipi optimization. Please take a
look.

The only concern which was unresolved is a messy bit
in default_setup_apic_routing(), so we've added a FIXME
there and clean it up as only time permits. Actually I
have a plan to merge probe_32/64.c into single file (and
even started working on this task) but not yes succeed.

Anyway I think patches should be in a good shape now and
probably we could merge them to not lose?

Comments are welcome.

Thanks,
Cyrill


2011-04-30 20:15:17

by Avi Kivity

[permalink] [raw]
Subject: Re: [patch 0/2] x2apic optimization, round 4

On 04/30/2011 08:14 PM, Cyrill Gorcunov wrote:
> Hi Ingo, here is an updated series of two patches for
> x2apic cluster mode ipi optimization. Please take a
> look.
>
> The only concern which was unresolved is a messy bit
> in default_setup_apic_routing(), so we've added a FIXME
> there and clean it up as only time permits. Actually I
> have a plan to merge probe_32/64.c into single file (and
> even started working on this task) but not yes succeed.
>
> Anyway I think patches should be in a good shape now and
> probably we could merge them to not lose?
>
> Comments are welcome.

Very nice! This will also significantly speed up kvm guests using x2apic.

--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

2011-04-30 20:34:05

by Cyrill Gorcunov

[permalink] [raw]
Subject: Re: [patch 0/2] x2apic optimization, round 4

On 05/01/2011 12:14 AM, Avi Kivity wrote:
> On 04/30/2011 08:14 PM, Cyrill Gorcunov wrote:
>> Hi Ingo, here is an updated series of two patches for
>> x2apic cluster mode ipi optimization. Please take a
>> look.
>>
>> The only concern which was unresolved is a messy bit
>> in default_setup_apic_routing(), so we've added a FIXME
>> there and clean it up as only time permits. Actually I
>> have a plan to merge probe_32/64.c into single file (and
>> even started working on this task) but not yes succeed.
>>
>> Anyway I think patches should be in a good shape now and
>> probably we could merge them to not lose?
>>
>> Comments are welcome.
>
> Very nice! This will also significantly speed up kvm guests using x2apic.
>

Yeah, indeed, i somehow forgot that we have x2apic mode in kvm (and just remember you've
been pointing me already about x2apic parameter for kvm ;)

--
Thanks,
Cyrill

2011-05-01 16:46:53

by Ingo Molnar

[permalink] [raw]
Subject: Re: [patch 0/2] x2apic optimization, round 4


* Avi Kivity <[email protected]> wrote:

> On 04/30/2011 08:14 PM, Cyrill Gorcunov wrote:
> > Hi Ingo, here is an updated series of two patches for
> >x2apic cluster mode ipi optimization. Please take a
> >look.
> >
> > The only concern which was unresolved is a messy bit
> >in default_setup_apic_routing(), so we've added a FIXME
> >there and clean it up as only time permits. Actually I
> >have a plan to merge probe_32/64.c into single file (and
> >even started working on this task) but not yes succeed.
> >
> > Anyway I think patches should be in a good shape now and
> >probably we could merge them to not lose?
> >
> > Comments are welcome.
>
> Very nice! This will also significantly speed up kvm guests using x2apic.

Ok. It would be nice to know on what systems these patches were tested, i.e. i
suppose x2apic-enabled ones?

Thanks,

Ingo

2011-05-01 17:11:36

by Cyrill Gorcunov

[permalink] [raw]
Subject: Re: [patch 0/2] x2apic optimization, round 4

On Sun, May 1, 2011 at 8:46 PM, Ingo Molnar <[email protected]> wrote:
>
> * Avi Kivity <[email protected]> wrote:
>
>> On 04/30/2011 08:14 PM, Cyrill Gorcunov wrote:
>> > ? Hi Ingo, here is an updated series of two patches for
>> >x2apic cluster mode ipi optimization. Please take a
>> >look.
>> >
>> > ? The only concern which was unresolved is a messy bit
>> >in default_setup_apic_routing(), so we've added a FIXME
>> >there and clean it up as only time permits. Actually I
>> >have a plan to merge probe_32/64.c into single file (and
>> >even started working on this task) but not yes succeed.
>> >
>> > ? Anyway I think patches should be in a good shape now and
>> >probably we could merge them to not lose?
>> >
>> > ? Comments are welcome.
>>
>> Very nice! ?This will also significantly speed up kvm guests using x2apic.
>
> Ok. It would be nice to know on what systems these patches were tested, i.e. i
> suppose x2apic-enabled ones?
>
> Thanks,
>
> ? ? ? ?Ingo
>

Suresh has tested them on Westmere-Ex system, I personally don't have
such machine.

2011-05-02 05:39:49

by Gleb Natapov

[permalink] [raw]
Subject: Re: [patch 0/2] x2apic optimization, round 4

On Sun, May 01, 2011 at 09:11:35PM +0400, Cyrill Gorcunov wrote:
> On Sun, May 1, 2011 at 8:46 PM, Ingo Molnar <[email protected]> wrote:
> >
> > * Avi Kivity <[email protected]> wrote:
> >
> >> On 04/30/2011 08:14 PM, Cyrill Gorcunov wrote:
> >> > ? Hi Ingo, here is an updated series of two patches for
> >> >x2apic cluster mode ipi optimization. Please take a
> >> >look.
> >> >
> >> > ? The only concern which was unresolved is a messy bit
> >> >in default_setup_apic_routing(), so we've added a FIXME
> >> >there and clean it up as only time permits. Actually I
> >> >have a plan to merge probe_32/64.c into single file (and
> >> >even started working on this task) but not yes succeed.
> >> >
> >> > ? Anyway I think patches should be in a good shape now and
> >> >probably we could merge them to not lose?
> >> >
> >> > ? Comments are welcome.
> >>
> >> Very nice! ?This will also significantly speed up kvm guests using x2apic.
> >
> > Ok. It would be nice to know on what systems these patches were tested, i.e. i
> > suppose x2apic-enabled ones?
> >
> > Thanks,
> >
> > ? ? ? ?Ingo
> >
>
> Suresh has tested them on Westmere-Ex system, I personally don't have
> such machine.
Can you test in in KVM with x2apic emulation enabled?

--
Gleb.

2011-05-02 05:51:36

by Cyrill Gorcunov

[permalink] [raw]
Subject: Re: [patch 0/2] x2apic optimization, round 4

Yeah, i'll do so as only bring my laptop to life, I managed to kill
grub and can't restore it back for a while, will ping you back as soon
as I can.

Sorry for top post.

On Monday, May 2, 2011, Gleb Natapov <[email protected]> wrote:
> On Sun, May 01, 2011 at 09:11:35PM +0400, Cyrill Gorcunov wrote:
>> On Sun, May 1, 2011 at 8:46 PM, Ingo Molnar <[email protected]> wrote:
>> >
>> > * Avi Kivity <[email protected]> wrote:
>> >
>> >> On 04/30/2011 08:14 PM, Cyrill Gorcunov wrote:
>> >> > ? Hi Ingo, here is an updated series of two patches for
>> >> >x2apic cluster mode ipi optimization. Please take a
>> >> >look.
>> >> >
>> >> > ? The only concern which was unresolved is a messy bit
>> >> >in default_setup_apic_routing(), so we've added a FIXME
>> >> >there and clean it up as only time permits. Actually I
>> >> >have a plan to merge probe_32/64.c into single file (and
>> >> >even started working on this task) but not yes succeed.
>> >> >
>> >> > ? Anyway I think patches should be in a good shape now and
>> >> >probably we could merge them to not lose?
>> >> >
>> >> > ? Comments are welcome.
>> >>
>> >> Very nice! ?This will also significantly speed up kvm guests using x2apic.
>> >
>> > Ok. It would be nice to know on what systems these patches were tested, i.e. i
>> > suppose x2apic-enabled ones?
>> >
>> > Thanks,
>> >
>> > ? ? ? ?Ingo
>> >
>>
>> Suresh has tested them on Westmere-Ex system, I personally don't have
>> such machine.
> Can you test in in KVM with x2apic emulation enabled?
>
> --
> ? ? ? ? ? ? ? ? ? ? ? ?Gleb.
>

2011-05-02 07:09:22

by Cyrill Gorcunov

[permalink] [raw]
Subject: Re: [patch 0/2] x2apic optimization, round 4

On 05/02/2011 09:51 AM, Cyrill Gorcunov wrote:
> Yeah, i'll do so as only bring my laptop to life, I managed to kill
> grub and can't restore it back for a while, will ping you back as soon
> as I can.
>
> Sorry for top post.
>

I've managed to semi-restore it. Gleb, maybe there some additional
parameter needed for kvm (except -cpu host,+x2apic) to make it work
with cluster mode? I always see physical mode which was not the target
of the patch series.

--
Thanks,
Cyrill

2011-05-02 07:45:46

by Gleb Natapov

[permalink] [raw]
Subject: Re: [patch 0/2] x2apic optimization, round 4

On Mon, May 02, 2011 at 11:09:16AM +0400, Cyrill Gorcunov wrote:
> On 05/02/2011 09:51 AM, Cyrill Gorcunov wrote:
> > Yeah, i'll do so as only bring my laptop to life, I managed to kill
> > grub and can't restore it back for a while, will ping you back as soon
> > as I can.
> >
> > Sorry for top post.
> >
>
> I've managed to semi-restore it. Gleb, maybe there some additional
> parameter needed for kvm (except -cpu host,+x2apic) to make it work
> with cluster mode? I always see physical mode which was not the target
> of the patch series.
>
Hmm, +x2apic is enough to advertise x2apic presents to the OS. What
logic Linux uses to decide which mode to use?

--
Gleb.

2011-05-02 07:52:33

by Cyrill Gorcunov

[permalink] [raw]
Subject: Re: [patch 0/2] x2apic optimization, round 4

On 05/02/2011 11:45 AM, Gleb Natapov wrote:
> On Mon, May 02, 2011 at 11:09:16AM +0400, Cyrill Gorcunov wrote:
>> On 05/02/2011 09:51 AM, Cyrill Gorcunov wrote:
>>> Yeah, i'll do so as only bring my laptop to life, I managed to kill
>>> grub and can't restore it back for a while, will ping you back as soon
>>> as I can.
>>>
>>> Sorry for top post.
>>>
>>
>> I've managed to semi-restore it. Gleb, maybe there some additional
>> parameter needed for kvm (except -cpu host,+x2apic) to make it work
>> with cluster mode? I always see physical mode which was not the target
>> of the patch series.
>>
> Hmm, +x2apic is enough to advertise x2apic presents to the OS. What
> logic Linux uses to decide which mode to use?
>
> --
> Gleb.

As far as I know interrupt remapping should be supported by kernel
to switch to logic cluster mode, so I presume kvm doesn't support
it yet and in result only physical mode is used. I think ACPI_SIG_DMAR
is missed in acpi tables (actually I didn't find it in kvm sources).

--
Thanks,
Cyrill

2011-05-02 08:04:46

by Gleb Natapov

[permalink] [raw]
Subject: Re: [patch 0/2] x2apic optimization, round 4

On Mon, May 02, 2011 at 11:52:26AM +0400, Cyrill Gorcunov wrote:
> On 05/02/2011 11:45 AM, Gleb Natapov wrote:
> > On Mon, May 02, 2011 at 11:09:16AM +0400, Cyrill Gorcunov wrote:
> >> On 05/02/2011 09:51 AM, Cyrill Gorcunov wrote:
> >>> Yeah, i'll do so as only bring my laptop to life, I managed to kill
> >>> grub and can't restore it back for a while, will ping you back as soon
> >>> as I can.
> >>>
> >>> Sorry for top post.
> >>>
> >>
> >> I've managed to semi-restore it. Gleb, maybe there some additional
> >> parameter needed for kvm (except -cpu host,+x2apic) to make it work
> >> with cluster mode? I always see physical mode which was not the target
> >> of the patch series.
> >>
> > Hmm, +x2apic is enough to advertise x2apic presents to the OS. What
> > logic Linux uses to decide which mode to use?
> >
> > --
> > Gleb.
>
> As far as I know interrupt remapping should be supported by kernel
> to switch to logic cluster mode, so I presume kvm doesn't support
> it yet and in result only physical mode is used. I think ACPI_SIG_DMAR
> is missed in acpi tables (actually I didn't find it in kvm sources).
>
Ahh, definitely. I recall that now.

--
Gleb.