Skip to contentSkip to conversation

mem usage and other application

Xenomai-help Maksym Veremeyenko 2 participants 11 messages Mar 14, 2007 – Mar 15, 2007

lore
Share & tools
lore
#0 lore raw

Hello!

I have a question about coexisting another applications on host that is under xenomai.

First my problem: running some applications cause not swap usage, memory statistics is:

Mem:    385000k total,    91908k used,   293092k free,    21180k buffers
Swap:  2000368k total,        0k used,  2000368k free,    42684k cached

and swap is constantly 0k used. Is it normal?

Second problem: other applications sometimes (50% attemps) fail to start (especially perl scripts and Eclipse) then at least one Xenomai application running.

I use linux 2.6.17.14, Adeos 1.5-02, Xenomai trunk 2170

________________________________________
Maksym Veremeyenko

#1 lore raw
Quoted 5 lines · Maksym Veremeyenko

Hello!

I have a question about coexisting another applications on host that is under xenomai.

Quoted 7 lines

First my problem: running some applications cause not swap usage, memory statistics is:

Mem:    385000k total,    91908k used,   293092k free,    21180k buffers
Swap:  2000368k total,        0k used,  2000368k free,    42684k cached

and swap is constantly 0k used. Is it normal?

If the system does not need swap, it does not use swap, I think it is normal.

Quoted 7 lines

Second problem: other applications sometimes (50% attemps) fail to start (especially perl scripts and Eclipse) then at least one Xenomai application running.

I use linux 2.6.17.14, Adeos 1.5-02, Xenomai trunk 2170

Could you try running "switchtest" while your Xenomai application is running ?

Signature · 1 line
					    Gilles Chanteperdrix.
#2 lore raw

Gilles Chanteperdrix пишет:

Quoted 10 lines
Quoted 6 lines

Second problem: other applications sometimes (50% attemps) fail to start (especially perl scripts and Eclipse) then at least one Xenomai application running.

I use linux 2.6.17.14, Adeos 1.5-02, Xenomai trunk 2170

Could you try running "switchtest" while your Xenomai application is running ?

during running program i got:
[[email protected] switchtest]# ./switchtest
== Testing FPU check routines...
r0: 1 != 2
r1: 1 != 2
r2: 1 != 2
r3: 1 != 2
r4: 1 != 2
r5: 1 != 2
r6: 1 != 2
r7: 1 != 2
== FPU check routines: OK. ioctl(RTTST_RTIOC_SWTEST_CREATE_KTASK): Cannot allocate memory == Threads: sleeper_ufps-0RTT| 326087:53:20

RTH|ctx switches|-------total
RTD|           0|           0

after stopping program:
[[email protected] switchtest]# ./switchtest
== Testing FPU check routines...
r0: 1 != 2
r1: 1 != 2
r2: 1 != 2
r3: 1 != 2
r4: 1 != 2
r5: 1 != 2
r6: 1 != 2
r7: 1 != 2
== FPU check routines: OK.
== Threads: sleeper_ufps-0 rtk-1 rtk-2 rtk_fp-3 rtk_fp-4 rtk_fp_ufpp-5 rtk_fp_ufpp-6 rtup-7 rtup-8 rtup_ufpp-9 rtup_ufpp-10 rtus-11 rtus-12 rtus_ufps-13 rtus_ufps-14 rtuo-15 rtuo-16 rtuo_ufpp-17 rtuo_ufpp-18 rtuo_ufps-19 rtuo_ufps-20 rtuo_ufpp_ufps-21 rtuo_ufpp_ufps-22

RTT|  00:00:01
RTH|ctx switches|-------total
RTD|       11500|       11500
RTD|       11523|       23023
RTD|       11523|       34546
RTD|       11523|       46069
RTD|       11500|       57569
RTD|        9108|       66677

switchtest's results are the same for two configurations:

1) kernel 2.6.17.14, xenomai 2.2.4, Adeos 1.5-00
2) kernel 2.6.17.14, xenomai 2.3.0-r2170, Adeos 1.5-02, debug enabled

except that in first configuration there are no fails (i did not found) of perl scrips or Eclipse.

Signature · 2 lines
________________________________________
Maksym Veremeyenko
#3 lore raw
Quoted 27 lines · Maksym Veremeyenko

Gilles Chanteperdrix ~~~~~:

Quoted 10 lines
Quoted 6 lines

Second problem: other applications sometimes (50% attemps) fail to start (especially perl scripts and Eclipse) then at least one Xenomai application running.

I use linux 2.6.17.14, Adeos 1.5-02, Xenomai trunk 2170

Could you try running "switchtest" while your Xenomai application is running ?

during running program i got:
[[email protected] switchtest]# ./switchtest
== Testing FPU check routines...
r0: 1 != 2
r1: 1 != 2
r2: 1 != 2
r3: 1 != 2
r4: 1 != 2
r5: 1 != 2
r6: 1 != 2
r7: 1 != 2
== FPU check routines: OK. ioctl(RTTST_RTIOC_SWTEST_CREATE_KTASK): Cannot allocate memory == Threads: sleeper_ufps-0RTT| 326087:53:20

Quoted 2 lines
RTH|ctx switches|-------total
RTD|           0|           0

You should probably increase the system heap size, with the option CONFIG_XENO_OPT_SYS_HEAPSZ

Signature · 1 line
					    Gilles Chanteperdrix.
#4 lore raw

Gilles Chanteperdrix пишет:

Quoted 2 lines

You should probably increase the system heap size, with the option CONFIG_XENO_OPT_SYS_HEAPSZ

There are problems with RT application, problem with non-RT application running on the same host, in the same time RT-application running...

Signature · 2 lines
________________________________________
Maksym Veremeyenko
#5 lore raw
Quoted 6 lines · Maksym Veremeyenko

Gilles Chanteperdrix ~~~~~:

Quoted 2 lines

You should probably increase the system heap size, with the option CONFIG_XENO_OPT_SYS_HEAPSZ

There are problems with RT application, problem with non-RT application running on the same host, in the same time RT-application running...

What I would like to know is if switchtest fails in the same condition as your non real-time applications, just to see if the situation you observe is an FPU bug. But for switchtest to start correctly, you need to increase CONFIG_XENO_OPT_SYS_HEAPSZ.

Signature · 1 line
					    Gilles Chanteperdrix.
#6 lore raw

Gilles Chanteperdrix пишет:

Quoted 5 lines

What I would like to know is if switchtest fails in the same condition as your non real-time applications, just to see if the situation you observe is an FPU bug. But for switchtest to start correctly, you need to increase CONFIG_XENO_OPT_SYS_HEAPSZ.

I significantly increased CONFIG_XENO_OPT_SYS_HEAPSZ and switchtest seems to me runs fine:

[[email protected] bin]# ./switchtest
== Testing FPU check routines...
r0: 1 != 2
r1: 1 != 2
r2: 1 != 2
r3: 1 != 2
r4: 1 != 2
r5: 1 != 2
r6: 1 != 2
r7: 1 != 2
== FPU check routines: OK.
== Threads: sleeper_ufps-0 rtk-1 rtk-2 rtk_fp-3 rtk_fp-4 rtk_fp_ufpp-5 rtk_fp_ufpp-6 rtup-7 rtup-8 rtup_ufpp-9 rtup_ufpp-10 rtus-11 rtus-12 rtus_ufps-13 rtus_ufps-14 rtuo-15 rtuo-16 rtuo_ufpp-17 rtuo_ufpp-18 rtuo_ufps-19 rtuo_ufps-20 rtuo_ufpp_ufps-21 rtuo_ufpp_ufps-22

RTT|  00:00:01
RTH|ctx switches|-------total
RTD|        7544|        7544
RTD|        7590|       15134
RTD|        7567|       22701
RTD|        7590|       30291
RTD|        7544|       37835
RTD|        7544|       45379
RTD|        7544|       52923
RTD|        7567|       60490
RTD|        7567|       68057
RTD|        7498|       75555
RTD|        7544|       83099
RTD|        7521|       90620
RTD|        7567|       98187
RTD|        7544|      105731
RTD|        7613|      113344
RTD|        7567|      120911
RTD|        7544|      128455
RTD|        7521|      135976
RTD|        7567|      143543
RTD|        7590|      151133
RTD|        7475|      158608
RTT|  00:00:22
RTH|ctx switches|-------total
RTD|        7613|      166221
RTD|        7567|      173788
RTD|        7544|      181332
RTD|        5244|      186576

My problem with non-RT application happens only if RT application (running in the same time) uses native skin. Perl and Eclipse application fails when switchbench is running, but not problems during switchtest.

Signature · 2 lines
________________________________________
Maksym Veremeyenko
#7 lore raw
Quoted 56 lines · Maksym Veremeyenko

Gilles Chanteperdrix ~~~~~:

Quoted 5 lines

What I would like to know is if switchtest fails in the same condition as your non real-time applications, just to see if the situation you observe is an FPU bug. But for switchtest to start correctly, you need to increase CONFIG_XENO_OPT_SYS_HEAPSZ.

I significantly increased CONFIG_XENO_OPT_SYS_HEAPSZ and switchtest seems to me runs fine:

[[email protected] bin]# ./switchtest
== Testing FPU check routines...
r0: 1 != 2
r1: 1 != 2
r2: 1 != 2
r3: 1 != 2
r4: 1 != 2
r5: 1 != 2
r6: 1 != 2
r7: 1 != 2
== FPU check routines: OK.
== Threads: sleeper_ufps-0 rtk-1 rtk-2 rtk_fp-3 rtk_fp-4 rtk_fp_ufpp-5 rtk_fp_ufpp-6 rtup-7 rtup-8 rtup_ufpp-9 rtup_ufpp-10 rtus-11 rtus-12 rtus_ufps-13 rtus_ufps-14 rtuo-15 rtuo-16 rtuo_ufpp-17 rtuo_ufpp-18 rtuo_ufps-19 rtuo_ufps-20 rtuo_ufpp_ufps-21 rtuo_ufpp_ufps-22

RTT|  00:00:01
RTH|ctx switches|-------total
RTD|        7544|        7544
RTD|        7590|       15134
RTD|        7567|       22701
RTD|        7590|       30291
RTD|        7544|       37835
RTD|        7544|       45379
RTD|        7544|       52923
RTD|        7567|       60490
RTD|        7567|       68057
RTD|        7498|       75555
RTD|        7544|       83099
RTD|        7521|       90620
RTD|        7567|       98187
RTD|        7544|      105731
RTD|        7613|      113344
RTD|        7567|      120911
RTD|        7544|      128455
RTD|        7521|      135976
RTD|        7567|      143543
RTD|        7590|      151133
RTD|        7475|      158608
RTT|  00:00:22
RTH|ctx switches|-------total
RTD|        7613|      166221
RTD|        7567|      173788
RTD|        7544|      181332
RTD|        5244|      186576
Quoted 4 lines

My problem with non-RT application happens only if RT application (running in the same time) uses native skin. Perl and Eclipse application fails when switchbench is running, but not problems during switchtest.

Ok. If you can run switchtest at the same time as your application and switchtest does not fail, it does not look like an FPU bug. What is the error message when perl or eclipse fail to start ?

Signature · 1 line
					    Gilles Chanteperdrix.
#8 lore raw

Gilles Chanteperdrix пишет:

Quoted 9 lines
Quoted 4 lines

My problem with non-RT application happens only if RT application (running in the same time) uses native skin. Perl and Eclipse application fails when switchbench is running, but not problems during switchtest.

Ok. If you can run switchtest at the same time as your application and switchtest does not fail, it does not look like an FPU bug. What is the error message when perl or eclipse fail to start ?

Perl scripts fails with various compilation errors - approximately 6 types (seems it could be much more if more modules were used).

Eclipse fails with Java VM init error:
[[email protected] ~]$ /usr/local//eclipse/eclipse Error occurred during initialization of VM java.lang.IllegalArgumentException: Illegal Load: NaN

During runned 'latency' i even have ssh fail:

Mar 15 01:47:18 dev-3 sshd[2908]: fatal: Couldn't obtain random bytes (error 604389476)
Mar 15 01:52:11 dev-3 sshd[3006]: Received signal 15; terminating.
Signature · 2 lines
________________________________________
Maksym Veremeyenko
#9 lore raw
Quoted 20 lines · Maksym Veremeyenko

Gilles Chanteperdrix ~~~~~:

Quoted 9 lines
Quoted 4 lines

My problem with non-RT application happens only if RT application (running in the same time) uses native skin. Perl and Eclipse application fails when switchbench is running, but not problems during switchtest.

Ok. If you can run switchtest at the same time as your application and switchtest does not fail, it does not look like an FPU bug. What is the error message when perl or eclipse fail to start ?

Perl scripts fails with various compilation errors - approximately 6 types (seems it could be much more if more modules were used).

Eclipse fails with Java VM init error:
[[email protected] ~]$ /usr/local//eclipse/eclipse Error occurred during initialization of VM java.lang.IllegalArgumentException: Illegal Load: NaN

Quoted 4 lines

During runned 'latency' i even have ssh fail:

Mar 15 01:47:18 dev-3 sshd[2908]: fatal: Couldn't obtain random bytes 
(error 604389476)
Mar 15 01:52:11 dev-3 sshd[3006]: Received signal 15; terminating.

Well, it really looks like an FPU bug. Could you try to:
- upgrade your trunk to latest revision, then test
- then apply the attached patch to your up-to-date trunk, then test again ?

Signature · 1 line
					    Gilles Chanteperdrix.
asm-i386/bits/pod.h +0 -33
Index: include/asm-i386/bits/pod.h
===================================================================
@@ -209,7 +209,6 @@
 {
 	struct task_struct *task = tcb->user_task;
 
-	if (!tcb->is_root) {
 		if (task) {
 			/* fpu not used or already saved by __switch_to. */
 			if (!wrap_test_fpu_used(task))
@@ -219,14 +218,7 @@
 		   	hardware of this task. */
 			wrap_clear_fpu_used(task);
 		}
-	} else {
-		if (tcb->cr0_ts || 
-		    (tcb->ts_usedfpu && !wrap_test_fpu_used(task)))
-			return;
 
-		wrap_clear_fpu_used(task);
-	}
-
 	clts();
 
 	if (cpu_has_fxsr)
@@ -239,7 +231,6 @@
 {
 	struct task_struct *task = tcb->user_task;
 
-	if (!tcb->is_root) {
 		if (task) {
 			if (!xnarch_fpu_init_p(task)) {
 				stts();
@@ -250,17 +241,7 @@
 			 * the FPU hardware. */
 			wrap_set_fpu_used(task);
 		}
-	} else {
-		/* Restore state of FPU only if TS bit in cr0 was clear. */
-		if (tcb->cr0_ts) {
-			stts();
-			return;
-		}
 
-		if (tcb->ts_usedfpu)
-			wrap_set_fpu_used(task);
-	}
-
 	/* Restore the FPU hardware with valid fp registers from a
 	   user-space or kernel thread. */
 	clts();
@@ -277,7 +258,6 @@
 {
 	struct task_struct *task = tcb->user_task;
 
-	if (!tcb->is_root) {
 		if (task) {
 			if (!xnarch_fpu_init_p(task))
 				return;
@@ -289,20 +269,7 @@
 				return;
 			}
 		}
-	} else {
-		if (tcb->cr0_ts)
-			return;
 
-		if (wrap_test_fpu_used(task)) {
-			/* Fpu context was not even saved, do not restore */
-			clts();
-			return;
-		}
-		
-		xnarch_restore_fpu(tcb);
-		return;
-	}
-
 	clts();
 
 	if (!cpu_has_fxsr && task)
#10 lore raw

Gilles Chanteperdrix пишет:

Quoted 5 lines

Well, it really looks like an FPU bug. Could you try to:
- upgrade your trunk to latest revision, then test
- then apply the attached patch to your up-to-date trunk, then test again ?

I used configuration 2.6.17.14, xenomai-r2299

Before patching xenomai result was the same and more faulty after decreasing RAM size down to 256M.

After applying patch situation become worth, i got "Bad pte" messages, sometimes "Soft lockup detected", and kernel dump:

Mar 15 04:08:21 dev-3 kernel: Bad pte = 42a5fef8, process = ???, vm_flags = 100073, vaddr = 42f60000
Mar 15 04:08:21 dev-3 kernel:  <c0102f70> show_trace+0x12/0x14 <c0103474> dump_stack+0x1c/0x1e
Mar 15 04:08:21 dev-3 kernel:  <c015c460> print_bad_pte+0x4f/0x5a <c015c4b1> vm_normal_page+0x46/0x5c
Mar 15 04:08:21 dev-3 kernel:  <c015c9d4> unmap_vmas+0x162/0x3e4 <c015f059> exit_mmap+0x55/0xc1
Mar 15 04:08:21 dev-3 kernel:  <c010feb8> mmput+0x5a/0xb0  <c0113161> exit_mm+0xe8/0xee
Mar 15 04:08:21 dev-3 kernel:  <c011459f> do_exit+0x1a2/0x719 <c010d21f> do_page_fault+0x4bf/0x542
Mar 15 04:08:21 dev-3 kernel:  <c010b1da> __ipipe_handle_exception+0x89/0xbf  <c0102988> error_code+0x54/0x64
Mar 15 04:08:21 dev-3 kernel: Bad pte = 42a5fef8, process = ???, vm_flags = 75, vaddr = 42f62000
Mar 15 04:08:21 dev-3 kernel:  <c0102f70> show_trace+0x12/0x14 <c0103474> dump_stack+0x1c/0x1e
Mar 15 04:08:21 dev-3 kernel:  <c015c460> print_bad_pte+0x4f/0x5a <c015c4b1> vm_normal_page+0x46/0x5c
Mar 15 04:08:21 dev-3 kernel:  <c015c9d4> unmap_vmas+0x162/0x3e4 <c015f059> exit_mmap+0x55/0xc1
Mar 15 04:08:21 dev-3 kernel:  <c010feb8> mmput+0x5a/0xb0  <c0113161> exit_mm+0xe8/0xee
Mar 15 04:08:21 dev-3 kernel:  <c011459f> do_exit+0x1a2/0x719 <c010d21f> do_page_fault+0x4bf/0x542
Mar 15 04:08:21 dev-3 kernel:  <c010b1da> __ipipe_handle_exception+0x89/0xbf  <c0102988> error_code+0x54/0x64
Mar 15 04:08:23 dev-3 kernel: ------------[ cut here ]------------
Mar 15 04:08:23 dev-3 kernel: kernel BUG at mm/rmap.c:560!
Mar 15 04:08:23 dev-3 kernel: invalid opcode: 0000 [#1]
Mar 15 04:08:23 dev-3 kernel: Modules linked in: xeno_16550A
Mar 15 04:08:23 dev-3 kernel: CPU:    0
Mar 15 04:08:23 dev-3 kernel: EIP:    0060:[<c01619f0>]    Not tainted VLI
Mar 15 04:08:23 dev-3 kernel: EFLAGS: 00010286 (2.6.17.14-xenomai-r2299-min-debug #3)
Mar 15 04:08:23 dev-3 kernel: EIP is at page_remove_rmap+0x1b/0x32
Mar 15 04:08:23 dev-3 kernel: eax: ffffffff   ebx: c1000000   ecx: c04d2aec   edx: c1000000
Mar 15 04:08:23 dev-3 kernel: esi: b7f79000   edi: d36f1de4   ebp: d351dce4   esp: d351dce4
Mar 15 04:08:23 dev-3 kernel: ds: 007b   es: 007b   ss: 0068
Mar 15 04:08:23 dev-3 kernel: Process bash (pid: 2698, threadinfo=d351c000 task=d500c030)
Mar 15 04:08:23 dev-3 kernel: Stack: d351dd3c c015caa6 00000000 d341f6fc d351dd54 00000000 00000001 b7fb3000
Mar 15 04:08:23 dev-3 kernel:        d3a5eb7c d55faa1c c04d2aec 00000000 ffffffff d55faa6c d3a5eb7c 00000019
Mar 15 04:08:23 dev-3 kernel:        003a4c2b b7fb3000 00000000 d351dd54 d3a08e04 d55faa1c d351dd64 c015f059
Mar 15 04:08:23 dev-3 kernel: Call Trace:
Mar 15 04:08:23 dev-3 kernel:  <c0102f26> show_stack_log_lvl+0x8a/0x94 <c01030ba> show_registers+0x148/0x1b4
Mar 15 04:08:23 dev-3 kernel:  <c010328a> die+0x164/0x262  <c0103409> do_trap+0x81/0x9b
Mar 15 04:08:23 dev-3 kernel:  <c0103b5e> do_invalid_op+0x8e/0x98 <c010b1da> __ipipe_handle_exception+0x89/0xbf
Mar 15 04:08:23 dev-3 kernel:  <c0102988> error_code+0x54/0x64 <c015caa6> unmap_vmas+0x234/0x3e4
Mar 15 04:08:23 dev-3 kernel:  <c015f059> exit_mmap+0x55/0xc1 <c010feb8> mmput+0x5a/0xb0
Mar 15 04:08:23 dev-3 kernel:  <c0175321> flush_old_exec+0x599/0x7c6 <c01904ad> load_elf_binary+0x4bf/0x1478
Mar 15 04:08:23 dev-3 kernel:  <c0174718> search_binary_handler+0x76/0x181  <c018f8e7> load_script+0x1b7/0x1cc
Mar 15 04:08:23 dev-3 kernel:  <c0174718> search_binary_handler+0x76/0x181  <c01760f5> do_execve+0x13f/0x1ac
Mar 15 04:08:23 dev-3 kernel:  <c010142b> sys_execve+0x2f/0x76 <c010269e> sysenter_past_esp+0x63/0x67
Mar 15 04:08:23 dev-3 kernel: Code: e8 7a 4b 13 00 8b 45 d0 83 c4 24 5b 5e 5f c9 c3 55 89 e5 e8 33 98 fa ff 89 c2 83 40 08 f
Mar 15 04:08:23 dev-3 kernel: EIP: [<c01619f0>] page_remove_rmap+0x1b/0x32 SS:ESP 0068:d351dce4

With latest trunk and 256MB i get stable errors even with "perl Makefile.PL" for XML-DOM-1.44 then any RT application used Native skin running.

Signature · 2 lines
________________________________________
Maksym Veremeyenko