FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 06-03-2008, 11:28 PM
Alok Kataria
 
Default Get rid of CPUID from gettimeofday

Hi,

There have been a series of patches committed to the mainline kernel
recently that address a performance issue for gettimeofday when running
on hypervisors that enable hardware assisted virtualization. The
non-ideal performance occurs because a CPUID instruction is used to
serialize the pipeline before RDTSC, and when using hardware
virtualization, CPUID always exits to the hypervisor.

The code in question also exists in the ubuntu-hardy tree.

The fix is to use MFENCE/LFENCE instead of CPUID.
This series of patches backports those commits for current ubuntu's git
tree.

Please have a look.

Thanks,
Alok


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 06-06-2008, 03:17 PM
Tim Gardner
 
Default Get rid of CPUID from gettimeofday

Alok Kataria wrote:
> Hi,
>
> There have been a series of patches committed to the mainline kernel
> recently that address a performance issue for gettimeofday when running
> on hypervisors that enable hardware assisted virtualization. The
> non-ideal performance occurs because a CPUID instruction is used to
> serialize the pipeline before RDTSC, and when using hardware
> virtualization, CPUID always exits to the hypervisor.
>
> The code in question also exists in the ubuntu-hardy tree.
>
> The fix is to use MFENCE/LFENCE instead of CPUID.
> This series of patches backports those commits for current ubuntu's git
> tree.
>
> Please have a look.
>
> Thanks,
> Alok
>

So, I've been messing with your patch set, but it is kind of wound up in
the 'TSC Clocksource' patch which I reverted because it was shown to
cause suspend regressions:

http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-hardy.git;a=commit;h=d617b07f7e8b465f29c82d84fbc12 febf43b2900

It was suggested in the LP report that the original TSC commit was
incomplete when compared to upstream:

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/226279/comments/95

In fact, this appears to be the case. I've re-applied the original TSC
patch, then your most recent patch set. Please review at
git://kernel.ubuntu.com/rtg/ubuntu-hardy-tsc.

I'll have a test build of this on my PPA sometime in the next couple of
days.

rtg

--
Tim Gardner tim.gardner@ubuntu.com

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 06-06-2008, 05:56 PM
Alok Kataria
 
Default Get rid of CPUID from gettimeofday

On Fri, 2008-06-06 at 08:17 -0700, Tim Gardner wrote:
> Alok Kataria wrote:
> > Hi,
> >
> > There have been a series of patches committed to the mainline kernel
> > recently that address a performance issue for gettimeofday when running
> > on hypervisors that enable hardware assisted virtualization. The
> > non-ideal performance occurs because a CPUID instruction is used to
> > serialize the pipeline before RDTSC, and when using hardware
> > virtualization, CPUID always exits to the hypervisor.
> >
> > The code in question also exists in the ubuntu-hardy tree.
> >
> > The fix is to use MFENCE/LFENCE instead of CPUID.
> > This series of patches backports those commits for current ubuntu's git
> > tree.
> >
> > Please have a look.
> >
> > Thanks,
> > Alok
> >
>
> So, I've been messing with your patch set, but it is kind of wound up in
> the 'TSC Clocksource' patch which I reverted because it was shown to
> cause suspend regressions:
>
> http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-hardy.git;a=commit;h=d617b07f7e8b465f29c82d84fbc12 febf43b2900
>
> It was suggested in the LP report that the original TSC commit was
> incomplete when compared to upstream:
>
> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/226279/comments/95
>
> In fact, this appears to be the case.

Hi Tim,

The patch that i had posted earlier for TSC did take into account the
software-suspend breakage.
Looking back at the mail conversation that we had back then, the patch
does have all those changes related to software suspend too. Attached is
the mail conversation.

> I've re-applied the original TSC
> patch, then your most recent patch set. Please review at
> git://kernel.ubuntu.com/rtg/ubuntu-hardy-tsc.

As far as these patches are concerned, i had a look, they seem correct.
Thanks for applying.

>
> I'll have a test build of this on my PPA sometime in the next couple of
> days.

Let me know incase you run into any problems.

Thanks,
Alok
>
> rtg
>
> --
> Tim Gardner tim.gardner@ubuntu.com
 
Old 06-06-2008, 07:13 PM
Tim Gardner
 
Default Get rid of CPUID from gettimeofday

This is a multi-part message in MIME format.Alok Kataria wrote:
> On Fri, 2008-06-06 at 08:17 -0700, Tim Gardner wrote:
>> Alok Kataria wrote:
>>> Hi,
>>>
>>> There have been a series of patches committed to the mainline kernel
>>> recently that address a performance issue for gettimeofday when running
>>> on hypervisors that enable hardware assisted virtualization. The
>>> non-ideal performance occurs because a CPUID instruction is used to
>>> serialize the pipeline before RDTSC, and when using hardware
>>> virtualization, CPUID always exits to the hypervisor.
>>>
>>> The code in question also exists in the ubuntu-hardy tree.
>>>
>>> The fix is to use MFENCE/LFENCE instead of CPUID.
>>> This series of patches backports those commits for current ubuntu's git
>>> tree.
>>>
>>> Please have a look.
>>>
>>> Thanks,
>>> Alok
>>>
>> So, I've been messing with your patch set, but it is kind of wound up in
>> the 'TSC Clocksource' patch which I reverted because it was shown to
>> cause suspend regressions:
>>
>> http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-hardy.git;a=commit;h=d617b07f7e8b465f29c82d84fbc12 febf43b2900
>>
>> It was suggested in the LP report that the original TSC commit was
>> incomplete when compared to upstream:
>>
>> https://bugs.launchpad.net/ubuntu/+source/linux/+bug/226279/comments/95
>>
>> In fact, this appears to be the case.
>
> Hi Tim,
>
> The patch that i had posted earlier for TSC did take into account the
> software-suspend breakage.
> Looking back at the mail conversation that we had back then, the patch
> does have all those changes related to software suspend too. Attached is
> the mail conversation.
>

It appears that the original TSC patch that I applied simply wasn't
applied correctly, it missed the patch to kernel/time/timekeeping.c. I
think it looks correct now.

>> I've re-applied the original TSC
>> patch, then your most recent patch set. Please review at
>> git://kernel.ubuntu.com/rtg/ubuntu-hardy-tsc.
>

I had to add support for native_read_tsc in order to build amd64. See
attached.

I've pushed to git://kernel.ubuntu.com/rtg/ubuntu-hardy-tsc

rtg
--
Tim Gardner tim.gardner@ubuntu.com
 
Old 06-06-2008, 07:52 PM
Alok Kataria
 
Default Get rid of CPUID from gettimeofday

On Fri, 2008-06-06 at 12:13 -0700, Tim Gardner wrote:
> Alok Kataria wrote:
> > On Fri, 2008-06-06 at 08:17 -0700, Tim Gardner wrote:
> >> Alok Kataria wrote:
> >
> > Hi Tim,
> >
> > The patch that i had posted earlier for TSC did take into account the
> > software-suspend breakage.
> > Looking back at the mail conversation that we had back then, the patch
> > does have all those changes related to software suspend too. Attached is
> > the mail conversation.
> >
>
> It appears that the original TSC patch that I applied simply wasn't
> applied correctly, it missed the patch to kernel/time/timekeeping.c. I
> think it looks correct now.
>
> >> I've re-applied the original TSC
> >> patch, then your most recent patch set. Please review at
> >> git://kernel.ubuntu.com/rtg/ubuntu-hardy-tsc.
> >
>
> I had to add support for native_read_tsc in order to build amd64. See
> attached.
>
> I've pushed to git://kernel.ubuntu.com/rtg/ubuntu-hardy-tsc
>
Yes.
Along with it we also need the attached patch which adds barriers to the
new native_read_tsc definition.

Thanks,
Alok
> rtg
> --
> Tim Gardner tim.gardner@ubuntu.com
 
Old 06-06-2008, 09:05 PM
Tim Gardner
 
Default Get rid of CPUID from gettimeofday

Alok Kataria wrote:
> On Fri, 2008-06-06 at 12:13 -0700, Tim Gardner wrote:
>> Alok Kataria wrote:
>>> On Fri, 2008-06-06 at 08:17 -0700, Tim Gardner wrote:
>>>> Alok Kataria wrote:
>>> Hi Tim,
>>>
>>> The patch that i had posted earlier for TSC did take into account the
>>> software-suspend breakage.
>>> Looking back at the mail conversation that we had back then, the patch
>>> does have all those changes related to software suspend too. Attached is
>>> the mail conversation.
>>>
>> It appears that the original TSC patch that I applied simply wasn't
>> applied correctly, it missed the patch to kernel/time/timekeeping.c. I
>> think it looks correct now.
>>
>>>> I've re-applied the original TSC
>>>> patch, then your most recent patch set. Please review at
>>>> git://kernel.ubuntu.com/rtg/ubuntu-hardy-tsc.
>> I had to add support for native_read_tsc in order to build amd64. See
>> attached.
>>
>> I've pushed to git://kernel.ubuntu.com/rtg/ubuntu-hardy-tsc
>>
> Yes.
> Along with it we also need the attached patch which adds barriers to the
> new native_read_tsc definition.
>
> Thanks,
> Alok
>> rtg
>> --
>> Tim Gardner tim.gardner@ubuntu.com

Doh! Thanks for catching that. I've applied this last barrier patch. I'm
hating xen right now. All of these patches have to be applied to the
corresponding include/asm-x86/mach-xen files.

rtg

--
Tim Gardner tim.gardner@ubuntu.com

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 12:14 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org