From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bei Guan Subject: Find the idle time of a physical cpu in Xen kernel Date: Wed, 16 Jul 2014 00:42:16 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6899193599548540399==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel List-Id: xen-devel@lists.xenproject.org --===============6899193599548540399== Content-Type: multipart/alternative; boundary=001a1133da661d39d704fe3e178d --001a1133da661d39d704fe3e178d Content-Type: text/plain; charset=UTF-8 Hi, I'd like to find the idle time of a physical cpu to calculate the pcpu utilization in Xen kernel (accurately, in the code file sched_credit.c). However, the method get_cpu_idle_time(cpu) doesn't seem to work well in the sched_credit.c. When the xen kernel boots, it blocked. Is there any other method getting the idle time of a pcpu in code file sched_credit.c? Another problem: the method vcpu_runstate_get() also doesn't work well in code file sched_credit.c. When the xen kernel boots, it has a "Panic" error. The debug information is pasted behind. How to get the running time of a vcpu in the code file sched_credit.c? Any suggestion is appreciated. Thank you very much. The debug message of using method vcpu_runstate_get() in code file sched _credit.c: (XEN) ----[ Xen-4.1.2 x86_64 debug=n Not tainted ]---- (XEN) CPU: 0 (XEN) RIP: e008:[] vcpu_runstate_get+0x33/0xc0 (XEN) RFLAGS: 0000000000010246 CONTEXT: hypervisor (XEN) rax: ffff8300df7f40c8 rbx: ffff8300df7f4000 rcx: 0000000000000000 (XEN) rdx: 0000000000000000 rsi: 0000000000000000 rdi: ffff8300df7f4000 (XEN) rbp: 0000000000000000 rsp: ffff82c48027fd18 r8: 0000000000003fff (XEN) r9: ffff830118a7c000 r10: ffff82c48029d880 r11: 0000000000000400 (XEN) r12: ffff82c48027fdb8 r13: ffff830118a93f68 r14: ffff82c48022f600 (XEN) r15: 0000000000000000 cr0: 000000008005003b cr4: 00000000000026f0 (XEN) cr3: 0000000115a10000 cr2: 0000000000000000 (XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: e010 cs: e008 (XEN) Xen stack trace from rsp=ffff82c48027fd18: (XEN) ffff8300df7f4000 ffff8300df7f4000 0000000000000000 ffff82c480117ff3 (XEN) 0000000000000000 ffff82c48011217c 0000000000000000 0000000000000000 (XEN) 0000000000000463 00000000000ff463 ffff830118a14000 00ff82c4801665b4 (XEN) 0000000000000001 ffff82c48027ff18 ffffffff81a01d18 ffff830100000000 (XEN) ffffffff81a01ce8 ffff82c48027fec0 ffff82c480298480 ffff82c48027fe88 (XEN) 00000000000000ff 0000000000000000 0000000000000001 ffff82c4802a9fc0 (XEN) ffff82c48027ff18 ffff83011ba0bd30 ffff82c4802bb6c0 0000000000000000 (XEN) 0000000000000000 ffff82c480118449 0000000000000960 ffff82c4802bb780 (XEN) ffff82c48022f600 ffff83011ba0ba10 ffff830118a92c70 ffff82c4802bb780 (XEN) ffff82c480118330 0000000000000000 0000000044e33fc1 ffff830118a92c78 (XEN) ffff830118a92c70 ffff82c480123b3b ffff82c4802bb780 ffff830118a92c70 (XEN) ffff83011ba0bd48 ffff82c4801240b7 ffff82c48027ff18 00000000000ff463 (XEN) ffff82c48027fec8 00000000ffffffff ffffffffffffffff ffff82c480298480 (XEN) ffff82c48027ff18 ffff82c48029c480 ffff82c480298480 ffff82c48012183d (XEN) ffff82c48027ff18 ffff8300df7f4000 ffffffff81a01d48 0000000000000001 (XEN) 00000000000f0735 000000000000c617 ffffffff81a01d10 ffff82c4801f5ca6 (XEN) ffffffff81a01d10 000000000000c617 00000000000f0735 0000000000000001 (XEN) ffffffff81a01d48 00000000000ebe17 0000000000000246 000000000000000e (XEN) 0000000000000016 7070616d20312d31 0000000000000001 ffffffff8100118a (XEN) 000000000000d2f2 ffffffff81a01ce8 0000000000000001 0000010000000000 (XEN) Xen call trace: (XEN) [] vcpu_runstate_get+0x33/0xc0 (XEN) [] _csched_cpu_pick+0xf3/0x410 (XEN) [] do_memory_op+0xd9c/0x1bd0 (XEN) [] csched_tick+0x119/0x370 (XEN) [] csched_tick+0x0/0x370 (XEN) [] execute_timer+0x4b/0x70 (XEN) [] timer_softirq_action+0x87/0x220 (XEN) [] __do_softirq+0x6d/0xb0 (XEN) [] process_softirqs+0x6/0x10 (XEN) (XEN) Pagetable walk from 0000000000000000: (XEN) L4[0x000] = 0000000000000000 ffffffffffffffff (XEN) (XEN) **************************************** (XEN) Panic on CPU 0: (XEN) FATAL PAGE FAULT (XEN) [error_code=0002] (XEN) Faulting linear address: 0000000000000000 (XEN) **************************************** (XEN) (XEN) Reboot in five seconds... (XEN) Resetting with ACPI MEMORY or I/O RESET_REG. -- Best Regards, Bei --001a1133da661d39d704fe3e178d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I'd like to find= the idle time of a physical cpu to calculate t= he pcpu utilization in Xen= kernel (accurately, in the code file sched_credit.c). However, the method get_cpu_idle= _time(cpu) doesn't seem to work well in the= sched_credit.c. When the xen= kernel boots, it blocked. Is there any other method getting = the idle time of a pcpu in code file sched_credit.c?

Another problem: the method vcpu= _runstate_get() also doesn't work w= ell in code file sched_credit.c. When the xen kernel boots, it has a "Panic" error= . The debug information is pasted behind. How to get the=C2=A0running time = of a vcpu=C2=A0in the code file sched_credit.c?

Any suggestion is appreciated. Thank you very much.


The debug message of using method vcpu_runstate_get() i= n code file sched_credit.c:

(XEN) ----[ Xen-4.1.2 =C2=A0x86_64 =C2=A0debug=3Dn =C2=A0Not tainted = ]----
(XEN) CPU: =C2=A0 =C2=A00
(XEN) RIP: =C2=A0 =C2=A0e008:[<ffff82c48011e7c3&= gt;] vcpu_runstate_get+0x33/0xc0
(XEN) RFLAGS= : 0000000000010246 =C2=A0 CONTEXT: hypervisor<= /div>
(XEN) rax: f= fff8300df7f40c8 =C2=A0 rbx: ffff8300df7f4000 = =C2=A0 rcx: 0000000000000000
(XEN) rdx: 0= 000000000000000 =C2=A0 rsi: 0000000000000000 = =C2=A0 rdi: ffff8300df7f4000
(XEN) rbp: 0= 000000000000000 =C2=A0 rsp: ffff82c48027fd18 = =C2=A0 r8: =C2=A00000000000003fff
(XEN) r9: =C2=A0ffff830118a7c000 =C2=A0 r= 10: ffff82c48029d880 =C2=A0 r11: 0000000000000400
(XEN) r12: ffff82c48027fdb8 =C2=A0 r13: f= fff830118a93f68 =C2=A0 r14: ffff82c48022f600
(XEN) r15: 0000000000000000 =C2=A0 cr0: 0= 00000008005003b =C2=A0 cr4: 00000000000026f0
(XEN) cr3: 0000000115a10000 =C2=A0 cr2: 0= 000000000000000
(XEN) ds: 00= 00 =C2=A0 es: 0000 =C2=A0 fs: 0000 =C2=A0 gs:= 0000 =C2=A0 ss: e010 =C2=A0 cs: e008
(XEN) Xen st= ack trace from rsp=3Dffff82c48027fd18:
(XEN) =C2=A0 =C2=A0ffff8300df7f4000 ffff8= 300df7f4000 0000000000000000 ffff82c480117ff3
(XEN) =C2=A0 =C2=A00000000000000000 ffff8= 2c48011217c 0000000000000000 0000000000000000
(XEN) =C2=A0 =C2=A00000000000000463 00000= 000000ff463 ffff830118a14000 00ff82c4801665b4
(XEN) =C2=A0 =C2=A00000000000000001 ffff8= 2c48027ff18 ffffffff81a01d18 ffff830100000000
(XEN) =C2=A0 =C2=A0ffffffff81a01ce8 ffff8= 2c48027fec0 ffff82c480298480 ffff82c48027fe88
(XEN) =C2=A0 =C2=A000000000000000ff 00000= 00000000000 0000000000000001 ffff82c4802a9fc0
(XEN) =C2=A0 =C2=A0ffff82c48027ff18 ffff8= 3011ba0bd30 ffff82c4802bb6c0 0000000000000000
(XEN) =C2=A0 =C2=A00000000000000000 ffff8= 2c480118449 0000000000000960 ffff82c4802bb780
(XEN) =C2=A0 =C2=A0ffff82c48022f600 ffff8= 3011ba0ba10 ffff830118a92c70 ffff82c4802bb780
(XEN) =C2=A0 =C2=A0ffff82c480118330 00000= 00000000000 0000000044e33fc1 ffff830118a92c78
(XEN) =C2=A0 =C2=A0ffff830118a92c70 ffff8= 2c480123b3b ffff82c4802bb780 ffff830118a92c70
(XEN) =C2=A0 =C2=A0ffff83011ba0bd48 ffff8= 2c4801240b7 ffff82c48027ff18 00000000000ff463
(XEN) =C2=A0 =C2=A0ffff82c48027fec8 00000= 000ffffffff ffffffffffffffff ffff82c48029848= 0
(XEN) =C2=A0 =C2=A0ffff82c48027ff18 ffff8= 2c48029c480 ffff82c480298480 ffff82c48012183d
(XEN) =C2=A0 =C2=A0ffff82c48027ff18 ffff8= 300df7f4000 ffffffff81a01d48 0000000000000001
(XEN) =C2=A0 =C2=A000000000000f0735 00000= 0000000c617 ffffffff81a01d10 ffff82c4801f5ca6
(XEN) =C2=A0 =C2=A0ffffffff81a01d10 00000= 0000000c617 00000000000f0735 0000000000000001
(XEN) =C2=A0 =C2=A0ffffffff81a01d48 00000= 000000ebe17 0000000000000246 000000000000000e
(XEN) =C2=A0 =C2=A00000000000000016 70706= 16d20312d31 0000000000000001 ffffffff8100118a
(XEN) =C2=A0 =C2=A0000000000000d2f2 fffff= fff81a01ce8 0000000000000001 0000010000000000
(XEN) Xen ca= ll trace:
(XEN) =C2=A0 =C2=A0[<ffff82c48011e7c3&= gt;] vcpu_runstate_get+0x33/0xc0
(XEN) =C2=A0 =C2=A0[<ffff82c480117ff3&= gt;] _csched_cpu_= pick+0xf3/0x410
(XEN) =C2=A0 =C2=A0[<ffff82c48011217c&= gt;] do_memory_op+0xd9c/0x1bd0
(XEN) =C2=A0 =C2=A0[<ffff82c480118449&= gt;] csched_tick+0x119/0x370
(XEN) =C2=A0 =C2=A0[<ffff82c480118330&= gt;] csched_tick+0x0/0x370
(XEN) =C2=A0 =C2=A0[<ffff82c480123b3b&= gt;] execute_timer+0x4b/0x70
(XEN) =C2=A0 =C2=A0[<ffff82c4801240b7&= gt;] timer_softirq_action+0x87/0x220
(XEN) =C2=A0 =C2=A0[<ffff82c48012183d&= gt;] __do_softirq+0x6d/0xb0
(XEN) =C2=A0 =C2=A0[<ffff82c4801f5ca6&= gt;] process_softirqs+0x6/0x10
(XEN) =C2=A0 =C2=A0
(XEN) Pagetable walk from 00= 00000000000000:
(XEN) =C2=A0L4[0x000] =3D 000000000000000= 0 ffffffffffffffff
(XEN)=C2=A0
(XEN= ) ****************************************
(XEN) Panic on CPU 0:
(= XEN) FATAL PAGE FAULT
(XEN) [error_code=3D0002]
(XEN) Faulting linear address: 0000000000000000
(XEN) **********************************= ******
(XEN)=C2=A0
(X= EN) Reboot in five seconds...
(XEN) Resetting with ACP= I MEMORY or I/O RESET_REG.

--
Best Regards,
Bei
--001a1133da661d39d704fe3e178d-- --===============6899193599548540399== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============6899193599548540399==--