All of lore.kernel.org
 help / color / mirror / Atom feed
* Tracking down a boot speed issue
       [not found] <844D15D284C78547BB0DAEE12D33A1B67C212BB956@FTLPMAILBOX02.citrite.net>
@ 2012-10-26 17:30 ` Roger Cruz
  2012-10-26 18:38   ` Ian Campbell
  0 siblings, 1 reply; 7+ messages in thread
From: Roger Cruz @ 2012-10-26 17:30 UTC (permalink / raw)
  To: xen-devel


With a Linux 3.2.23 PVOPs and Xen 4.0.4, I am observing that boot speed takes a hit when the following per_cpu access is made  in arch/x86/xen/enlighthen.c:xen_vcpu_setup().  The slow down is caused by the term on the left of the equal sign, ie, access to the per cpu area.  As you see from the timed samples below, the access can take anywhere from .6 to 1.2 secs (though I have seen it take 1.6 secs every single time with  Linux 3.2.16 and Xen 4.0.3).  Subsequent iterations from the loop do not incur the expense.  It also doesn't happen on older CPUs from what I can tell, only in the newer Sandybridge Intel i-series processors.  My initial guess is that there is some sort of page fault taking place but I haven't been able to confirm that.  Any ideas on how to track this farther down into Xe
 n to isolate and understand what is going on?

Thank you.  
Roger R. Cruz

            printk(KERN_ALERT "in cpu loop %d for shared info", cpu);
===>    per_cpu(xen_vcpu,cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu];
            printk(KERN_ALERT "in cpu loop %d computed shared info", cpu);

Oct 25 20:24:11 23445LU-PBBFMWY kernel: [    0.000000] in cpu loop 0 for shared info
Oct 25 20:24:11 23445LU-PBBFMWY kernel: [    1.238877] in cpu loop 0 computed shared info

Oct 25 20:52:53 23445LU-PBBFMWY kernel: [    0.000000] in cpu loop 0 for shared info
Oct 25 20:52:53 23445LU-PBBFMWY kernel: [    0.718365] in cpu loop 0 computed shared info

Oct 25 20:41:27 23445LU-PBBFMWY kernel: [    0.000000] in cpu loop 0 for shared info
Oct 25 20:41:27 23445LU-PBBFMWY kernel: [    0.671690] in cpu loop 0 computed shared info

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Tracking down a boot speed issue
  2012-10-26 17:30 ` Tracking down a boot speed issue Roger Cruz
@ 2012-10-26 18:38   ` Ian Campbell
  2012-10-26 18:55     ` Roger Cruz
  2012-10-26 19:02     ` Roger Cruz
  0 siblings, 2 replies; 7+ messages in thread
From: Ian Campbell @ 2012-10-26 18:38 UTC (permalink / raw)
  To: Roger Cruz; +Cc: xen-devel

On Fri, 2012-10-26 at 18:30 +0100, Roger Cruz wrote:
> As you see from the timed samples below, the access can take anywhere
> from .6 to 1.2 secs (though I have seen it take 1.6 secs every single
> time with  Linux 3.2.16 and Xen 4.0.3).

Isn't this just because setting up the per-cpu shared info makes the
time available to printk. Note that the timestamp is zero beforehand
(a big hint that time isn't setup yet). Also see xen_clocksource_read().

IOW I think what is being measured here is the time from start of day
until the second printk, not the time between the two prints.

[...]
>             printk(KERN_ALERT "in cpu loop %d for shared info", cpu);
> ===>    per_cpu(xen_vcpu,cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu];
>             printk(KERN_ALERT "in cpu loop %d computed shared info", cpu);
> 
> Oct 25 20:24:11 23445LU-PBBFMWY kernel: [    0.000000] in cpu loop 0 for shared info
> Oct 25 20:24:11 23445LU-PBBFMWY kernel: [    1.238877] in cpu loop 0 computed shared info
> 
> Oct 25 20:52:53 23445LU-PBBFMWY kernel: [    0.000000] in cpu loop 0 for shared info
> Oct 25 20:52:53 23445LU-PBBFMWY kernel: [    0.718365] in cpu loop 0 computed shared info
> 
> Oct 25 20:41:27 23445LU-PBBFMWY kernel: [    0.000000] in cpu loop 0 for shared info
> Oct 25 20:41:27 23445LU-PBBFMWY kernel: [    0.671690] in cpu loop 0 computed shared info
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Tracking down a boot speed issue
  2012-10-26 18:38   ` Ian Campbell
@ 2012-10-26 18:55     ` Roger Cruz
  2012-10-27 10:45       ` Ian Campbell
  2012-10-26 19:02     ` Roger Cruz
  1 sibling, 1 reply; 7+ messages in thread
From: Roger Cruz @ 2012-10-26 18:55 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

Well, that may be a good clue or reason for what I have been thinking was a long time to setup the zonelists (that is how it shows up when looking at an untouched kernel).  So if I understand your response correctly.. the time displayed will always be zero until the per_cpu area is set up? 
________________________________________
From: Ian Campbell [Ian.Campbell@citrix.com]
Sent: Friday, October 26, 2012 2:38 PM
To: Roger Cruz
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Tracking down a boot speed issue

On Fri, 2012-10-26 at 18:30 +0100, Roger Cruz wrote:
> As you see from the timed samples below, the access can take anywhere
> from .6 to 1.2 secs (though I have seen it take 1.6 secs every single
> time with  Linux 3.2.16 and Xen 4.0.3).

Isn't this just because setting up the per-cpu shared info makes the
time available to printk. Note that the timestamp is zero beforehand
(a big hint that time isn't setup yet). Also see xen_clocksource_read().

IOW I think what is being measured here is the time from start of day
until the second printk, not the time between the two prints.

[...]
>             printk(KERN_ALERT "in cpu loop %d for shared info", cpu);
> ===>    per_cpu(xen_vcpu,cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu];
>             printk(KERN_ALERT "in cpu loop %d computed shared info", cpu);
>
> Oct 25 20:24:11 23445LU-PBBFMWY kernel: [    0.000000] in cpu loop 0 for shared info
> Oct 25 20:24:11 23445LU-PBBFMWY kernel: [    1.238877] in cpu loop 0 computed shared info
>
> Oct 25 20:52:53 23445LU-PBBFMWY kernel: [    0.000000] in cpu loop 0 for shared info
> Oct 25 20:52:53 23445LU-PBBFMWY kernel: [    0.718365] in cpu loop 0 computed shared info
>
> Oct 25 20:41:27 23445LU-PBBFMWY kernel: [    0.000000] in cpu loop 0 for shared info
> Oct 25 20:41:27 23445LU-PBBFMWY kernel: [    0.671690] in cpu loop 0 computed shared info
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Tracking down a boot speed issue
  2012-10-26 18:38   ` Ian Campbell
  2012-10-26 18:55     ` Roger Cruz
@ 2012-10-26 19:02     ` Roger Cruz
  2012-10-27 10:46       ` Ian Campbell
  1 sibling, 1 reply; 7+ messages in thread
From: Roger Cruz @ 2012-10-26 19:02 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

A question remains in my mind as why the times are variable.  Why does it take .67 secs and 1.6 secs other times for exactly the same boot code?
________________________________________
From: Ian Campbell [Ian.Campbell@citrix.com]
Sent: Friday, October 26, 2012 2:38 PM
To: Roger Cruz
Cc: xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Tracking down a boot speed issue

On Fri, 2012-10-26 at 18:30 +0100, Roger Cruz wrote:
> As you see from the timed samples below, the access can take anywhere
> from .6 to 1.2 secs (though I have seen it take 1.6 secs every single
> time with  Linux 3.2.16 and Xen 4.0.3).

Isn't this just because setting up the per-cpu shared info makes the
time available to printk. Note that the timestamp is zero beforehand
(a big hint that time isn't setup yet). Also see xen_clocksource_read().

IOW I think what is being measured here is the time from start of day
until the second printk, not the time between the two prints.

[...]
>             printk(KERN_ALERT "in cpu loop %d for shared info", cpu);
> ===>    per_cpu(xen_vcpu,cpu) = &HYPERVISOR_shared_info->vcpu_info[cpu];
>             printk(KERN_ALERT "in cpu loop %d computed shared info", cpu);
>
> Oct 25 20:24:11 23445LU-PBBFMWY kernel: [    0.000000] in cpu loop 0 for shared info
> Oct 25 20:24:11 23445LU-PBBFMWY kernel: [    1.238877] in cpu loop 0 computed shared info
>
> Oct 25 20:52:53 23445LU-PBBFMWY kernel: [    0.000000] in cpu loop 0 for shared info
> Oct 25 20:52:53 23445LU-PBBFMWY kernel: [    0.718365] in cpu loop 0 computed shared info
>
> Oct 25 20:41:27 23445LU-PBBFMWY kernel: [    0.000000] in cpu loop 0 for shared info
> Oct 25 20:41:27 23445LU-PBBFMWY kernel: [    0.671690] in cpu loop 0 computed shared info
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Tracking down a boot speed issue
  2012-10-26 18:55     ` Roger Cruz
@ 2012-10-27 10:45       ` Ian Campbell
  0 siblings, 0 replies; 7+ messages in thread
From: Ian Campbell @ 2012-10-27 10:45 UTC (permalink / raw)
  To: Roger Cruz; +Cc: xen-devel

Please don't top-post.

On Fri, 2012-10-26 at 19:55 +0100, Roger Cruz wrote:
> So if I understand your response correctly.. the time displayed will
> always be zero until the per_cpu area is set up? 

Correct.

Ian.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Tracking down a boot speed issue
  2012-10-26 19:02     ` Roger Cruz
@ 2012-10-27 10:46       ` Ian Campbell
  2012-10-29  9:53         ` Jan Beulich
  0 siblings, 1 reply; 7+ messages in thread
From: Ian Campbell @ 2012-10-27 10:46 UTC (permalink / raw)
  To: Roger Cruz; +Cc: xen-devel

On Fri, 2012-10-26 at 20:02 +0100, Roger Cruz wrote:
> A question remains in my mind as why the times are variable.  Why does
> it take .67 secs and 1.6 secs other times for exactly the same boot
> code?

Something before this point takes a variable amount of time perhaps? I
don't know what happens before this point in the boot.

Ian.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Tracking down a boot speed issue
  2012-10-27 10:46       ` Ian Campbell
@ 2012-10-29  9:53         ` Jan Beulich
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Beulich @ 2012-10-29  9:53 UTC (permalink / raw)
  To: Ian Campbell, Roger Cruz; +Cc: xen-devel

>>> On 27.10.12 at 12:46, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> On Fri, 2012-10-26 at 20:02 +0100, Roger Cruz wrote:
>> A question remains in my mind as why the times are variable.  Why does
>> it take .67 secs and 1.6 secs other times for exactly the same boot
>> code?
> 
> Something before this point takes a variable amount of time perhaps? I
> don't know what happens before this point in the boot.

This may be a direct effect of not being the only VM on the
underlying host (i.e. there can be any amount of stolen time
included in that initial time period).

Jan

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-10-29  9:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <844D15D284C78547BB0DAEE12D33A1B67C212BB956@FTLPMAILBOX02.citrite.net>
2012-10-26 17:30 ` Tracking down a boot speed issue Roger Cruz
2012-10-26 18:38   ` Ian Campbell
2012-10-26 18:55     ` Roger Cruz
2012-10-27 10:45       ` Ian Campbell
2012-10-26 19:02     ` Roger Cruz
2012-10-27 10:46       ` Ian Campbell
2012-10-29  9:53         ` Jan Beulich

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.