Skip to contentSkip to conversation

memory allocation performance in kernel ipipe

Xenomai Stéphane Ancelot 3 participants 9 messages Dec 7, 2016 – Jan 16, 2017

lore
Share & tools
lore
#0 lore raw

Hi,

I noticed very bad memory allocation performance on some of my graphic programs (standard linux applications).

If you run any classic program, you won't sea any difference, but it has been visible in the following context :

I have an application that allocates thousends of graphic widgets, label, input fields at startup (a data editor) .

Using the standard kernel, the applications starts very quickly. But once the ipipe patch is applied to kernel, this application makes lot of seconds before appearing.

I am using a 3.18 kernel.

I made a diff on both standards and ipipe kernel configs :
236a237

Quoted 1 line

CONFIG_KPROBES_ON_FTRACE=y

372a374,382

Quoted 9 lines

CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_DEBUG is not set
# CONFIG_PARAVIRT_SPINLOCKS is not set
# CONFIG_XEN is not set
CONFIG_KVM_GUEST=y
# CONFIG_KVM_DEBUG_FS is not set
# CONFIG_LGUEST_GUEST is not set
# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
CONFIG_PARAVIRT_CLOCK=y

427,435d436
< CONFIG_IPIPE=y
< # CONFIG_IPIPE_LEGACY is not set
< CONFIG_IPIPE_CORE=y
< CONFIG_IPIPE_WANT_CLOCKSOURCE=y
< CONFIG_IPIPE_WANT_PTE_PINNING=y
< CONFIG_IPIPE_CORE_APIREV=2
< CONFIG_IPIPE_TARGET_APIREV=2
< CONFIG_IPIPE_HAVE_HOSTRT=y
< CONFIG_IPIPE_HAVE_VM_NOTIFIER=y
512a514,516

Quoted 3 lines

CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set

6237d6240
< # CONFIG_IPIPE_DEBUG is not set
6356a6360,6361

Quoted 2 lines

CONFIG_DYNAMIC_FTRACE=y
CONFIG_DYNAMIC_FTRACE_WITH_REGS=y

6357a6363

Quoted 1 line

CONFIG_FTRACE_MCOUNT_RECORD=y

Regards,
S.Ancelot

#1 lore raw
Quoted 8 lines · Stéphane Ancelot

Hi,

I noticed very bad memory allocation performance on some of my graphic programs (standard linux applications).

If you run any classic program, you won't sea any difference, but it has been visible in the following context :

Quoted 9 lines

I have an application that allocates thousends of graphic widgets, label, input fields at startup (a data editor) .

Using the standard kernel, the applications starts very quickly. But once the ipipe patch is applied to kernel, this application makes lot of seconds before appearing.

I am using a 3.18 kernel.

Is there any question?

Signature · 1 line
Philippe.
#2 lore raw
Quoted 12 lines · Philippe Gerum
Quoted 11 lines · Stéphane Ancelot

Hi,

I noticed very bad memory allocation performance on some of my graphic programs (standard linux applications).

If you run any classic program, you won't sea any difference, but it has been visible in the following context :

I have an application that allocates thousends of graphic widgets, label, input fields at startup (a data editor) .

Quoted 8 lines
Quoted 6 lines

Using the standard kernel, the applications starts very quickly. But once the ipipe patch is applied to kernel, this application makes lot of seconds before appearing.

I am using a 3.18 kernel.

Is there any question?

Euhhh ... yes, it sounds this problem comes from ipipe modifications, But I have not managed to find the reason ??? Is it a bug , a regression , a kernel routine where the problem is amplified once the patch is applied ?

I remember I have not had this problem with previous kernel releases (3.16.x) . I will check again with previous configurations, in order to find a way of comparison.

Regards,
S.Ancelot

#3 lore raw

Am Thu, 8 Dec 2016 08:28:02 +0100
schrieb Stéphane Ancelot <[email protected]>:

Quoted 21 lines · Philippe Gerum
Quoted 12 lines · Stéphane Ancelot
Quoted 11 lines

Hi,

I noticed very bad memory allocation performance on some of my graphic programs (standard linux applications).

If you run any classic program, you won't sea any difference, but it has been visible in the following context :

I have an application that allocates thousends of graphic widgets, label, input fields at startup (a data editor) .

Quoted 8 lines
Quoted 6 lines

Using the standard kernel, the applications starts very quickly. But once the ipipe patch is applied to kernel, this application makes lot of seconds before appearing.

I am using a 3.18 kernel.

Is there any question?

Quoted 8 lines

Euhhh ... yes, it sounds this problem comes from ipipe modifications, But I have not managed to find the reason ??? Is it a bug , a regression , a kernel routine where the problem is amplified once the patch is applied ?

I remember I have not had this problem with previous kernel releases (3.16.x) . I will check again with previous configurations, in order to find a way of comparison.

You can also try 4.1. And more information could be useful. Which version of xenomai are you using? Is your application using xenomai? Which architecture are you on?

Quoted 7 lines

Regards,
S.Ancelot

_______________________________________________
Xenomai mailing list
[email protected]
https://xenomai.org/mailman/listinfo/xenomai

#4 lore raw
Quoted 29 lines · Henning Schild

Am Thu, 8 Dec 2016 08:28:02 +0100
schrieb Stéphane Ancelot <[email protected]>:

Quoted 26 lines · Philippe Gerum
Quoted 12 lines · Stéphane Ancelot
Quoted 11 lines

Hi,

I noticed very bad memory allocation performance on some of my graphic programs (standard linux applications).

If you run any classic program, you won't sea any difference, but it has been visible in the following context :

I have an application that allocates thousends of graphic widgets, label, input fields at startup (a data editor) .

Quoted 8 lines
Quoted 6 lines

Using the standard kernel, the applications starts very quickly. But once the ipipe patch is applied to kernel, this application makes lot of seconds before appearing.

I am using a 3.18 kernel.

Is there any question?

Euhhh ... yes, it sounds this problem comes from ipipe modifications, But I have not managed to find the reason ??? Is it a bug , a regression , a kernel routine where the problem is amplified once the patch is applied ?

Quoted 6 lines
Quoted 3 lines

I remember I have not had this problem with previous kernel releases (3.16.x) . I will check again with previous configurations, in order to find a way of comparison.

You can also try 4.1. And more information could be useful. Which version of xenomai are you using? Is your application using xenomai? Which architecture are you on?

I checked following things :

I have problem with any kernel on this architecture patched with xenomai.

I tried kernel 3.16.7,3.18.20 and 4.1.18.
this happens in 32 bit or 64 bit, both SMP kernel

I made 2 traces to open with kernelshark (please advice if it is a problem). you have to filter task : chg_cst

this one is when the problem is happening using the computer display.

https://drive.google.com/open?id=0B1JEDrsMi1E1YkZja1dsWTFRcDQ

and this one is when it runs fine through a ssh -X session.
https://drive.google.com/open?id=0B1JEDrsMi1E1WUVyOUFEbFdzWkk

comparing both tasks diagram , I can sea that when it does not work, the task is interrupted for a long time. in other case, no interruption in it's activity diagram.

Regards,
S.Ancelot

Quoted 7 lines
Quoted 7 lines

Regards,
S.Ancelot

_______________________________________________
Xenomai mailing list
[email protected]
https://xenomai.org/mailman/listinfo/xenomai

#5 lore raw
Quoted 3 lines · Stéphane Ancelot
Quoted 2 lines
Quoted 2 lines

I remember I have not had this problem with previous kernel releases (3.16.x) .

I tried kernel 3.16.7,3.18.20 and 4.1.18.

So there is eventually an issue with your app on a 3.16 kernel, unlike the initial post suggested?

Quoted 7 lines

this happens in 32 bit or 64 bit, both SMP kernel

I made 2 traces to open with kernelshark (please advice if it is a problem). you have to filter task : chg_cst

this one is when the problem is happening using the computer display.

Quoted 8 lines

https://drive.google.com/open?id=0B1JEDrsMi1E1YkZja1dsWTFRcDQ

and this one is when it runs fine through a ssh -X session.
https://drive.google.com/open?id=0B1JEDrsMi1E1WUVyOUFEbFdzWkk

comparing both tasks diagram , I can sea that when it does not work, the task is interrupted for a long time.
in other case, no interruption in it's activity diagram.

Interrupted by which activity, where, at which timestamp of this massive trace file? Please give us accurate, detailed and precise information for us to help, I don't think anyone on this list could invest much time diving into a 95Mb trace dump.

Signature · 1 line
Philippe.
#6 lore raw

Hi,

after analysis, the problem was coming from Xorg intel i965 driver and xorg 1.16.

Migrating to recent xorg 1.19 kernel solved the problem.

Regards,

S.Ancelot

Quoted 28 lines · Philippe Gerum
Quoted 3 lines · Stéphane Ancelot
Quoted 2 lines
Quoted 2 lines

I remember I have not had this problem with previous kernel releases (3.16.x) .

I tried kernel 3.16.7,3.18.20 and 4.1.18.

So there is eventually an issue with your app on a 3.16 kernel, unlike the initial post suggested?

Quoted 7 lines

this happens in 32 bit or 64 bit, both SMP kernel

I made 2 traces to open with kernelshark (please advice if it is a problem). you have to filter task : chg_cst

this one is when the problem is happening using the computer display.

Quoted 8 lines

https://drive.google.com/open?id=0B1JEDrsMi1E1YkZja1dsWTFRcDQ

and this one is when it runs fine through a ssh -X session.
https://drive.google.com/open?id=0B1JEDrsMi1E1WUVyOUFEbFdzWkk

comparing both tasks diagram , I can sea that when it does not work, the task is interrupted for a long time.
in other case, no interruption in it's activity diagram.

Interrupted by which activity, where, at which timestamp of this massive trace file? Please give us accurate, detailed and precise information for us to help, I don't think anyone on this list could invest much time diving into a 95Mb trace dump.

#7 lore raw
In reply to Stéphane Ancelot

Am Wed, 7 Dec 2016 15:15:39 +0100
schrieb Stéphane Ancelot <[email protected]>:

Quoted 8 lines

Hi,

I noticed very bad memory allocation performance on some of my graphic programs (standard linux applications).

If you run any classic program, you won't sea any difference, but it has been visible in the following context :

Quoted 6 lines

I have an application that allocates thousends of graphic widgets, label, input fields at startup (a data editor) .

Using the standard kernel, the applications starts very quickly. But once the ipipe patch is applied to kernel, this application makes lot of seconds before appearing.

You could profile/trace the application on both kernels and compare the profiles from both kernels. That should allow you to narrow down on the operations that are slower on ipipe. But with the high level description you gave so far, it is hard to tell what is going on. A third kernel you could try is the ipipe-patched kernel with ipipe disabled, see how that works.

Henning

Quoted 45 lines

I am using a 3.18 kernel.

I made a diff on both standards and ipipe kernel configs :
236a237

Quoted 1 line

CONFIG_KPROBES_ON_FTRACE=y

372a374,382

Quoted 9 lines

CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_DEBUG is not set
# CONFIG_PARAVIRT_SPINLOCKS is not set
# CONFIG_XEN is not set
CONFIG_KVM_GUEST=y
# CONFIG_KVM_DEBUG_FS is not set
# CONFIG_LGUEST_GUEST is not set
# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
CONFIG_PARAVIRT_CLOCK=y

427,435d436
< CONFIG_IPIPE=y
< # CONFIG_IPIPE_LEGACY is not set
< CONFIG_IPIPE_CORE=y
< CONFIG_IPIPE_WANT_CLOCKSOURCE=y
< CONFIG_IPIPE_WANT_PTE_PINNING=y
< CONFIG_IPIPE_CORE_APIREV=2
< CONFIG_IPIPE_TARGET_APIREV=2
< CONFIG_IPIPE_HAVE_HOSTRT=y
< CONFIG_IPIPE_HAVE_VM_NOTIFIER=y
512a514,516

Quoted 3 lines

CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set

6237d6240
< # CONFIG_IPIPE_DEBUG is not set
6356a6360,6361

Quoted 2 lines

CONFIG_DYNAMIC_FTRACE=y
CONFIG_DYNAMIC_FTRACE_WITH_REGS=y

6357a6363

Quoted 1 line

CONFIG_FTRACE_MCOUNT_RECORD=y

Regards,
S.Ancelot

_______________________________________________
Xenomai mailing list
[email protected]
https://xenomai.org/mailman/listinfo/xenomai

#8 lore raw
Quoted 17 lines · Henning Schild

Am Wed, 7 Dec 2016 15:15:39 +0100
schrieb Stéphane Ancelot <[email protected]>:

Quoted 8 lines

Hi,

I noticed very bad memory allocation performance on some of my graphic programs (standard linux applications).

If you run any classic program, you won't sea any difference, but it has been visible in the following context :

Quoted 6 lines

I have an application that allocates thousends of graphic widgets, label, input fields at startup (a data editor) .

Using the standard kernel, the applications starts very quickly. But once the ipipe patch is applied to kernel, this application makes lot of seconds before appearing.

Quoted 8 lines

You could profile/trace the application on both kernels and compare the profiles from both kernels. That should allow you to narrow down on the operations that are slower on ipipe. But with the high level description you gave so far, it is hard to tell what is going on. A third kernel you could try is the ipipe-patched kernel with ipipe disabled, see how that works.

Henning

An interesting note I can add :
if the same program is launched on a remote session with ssh -X , the program starts efficiently and quickly.

Quoted 45 lines
Quoted 45 lines

I am using a 3.18 kernel.

I made a diff on both standards and ipipe kernel configs :
236a237

Quoted 1 line

CONFIG_KPROBES_ON_FTRACE=y

372a374,382

Quoted 9 lines

CONFIG_PARAVIRT=y
# CONFIG_PARAVIRT_DEBUG is not set
# CONFIG_PARAVIRT_SPINLOCKS is not set
# CONFIG_XEN is not set
CONFIG_KVM_GUEST=y
# CONFIG_KVM_DEBUG_FS is not set
# CONFIG_LGUEST_GUEST is not set
# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
CONFIG_PARAVIRT_CLOCK=y

427,435d436
< CONFIG_IPIPE=y
< # CONFIG_IPIPE_LEGACY is not set
< CONFIG_IPIPE_CORE=y
< CONFIG_IPIPE_WANT_CLOCKSOURCE=y
< CONFIG_IPIPE_WANT_PTE_PINNING=y
< CONFIG_IPIPE_CORE_APIREV=2
< CONFIG_IPIPE_TARGET_APIREV=2
< CONFIG_IPIPE_HAVE_HOSTRT=y
< CONFIG_IPIPE_HAVE_VM_NOTIFIER=y
512a514,516

Quoted 3 lines

CONFIG_TRANSPARENT_HUGEPAGE=y
CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set

6237d6240
< # CONFIG_IPIPE_DEBUG is not set
6356a6360,6361

Quoted 2 lines

CONFIG_DYNAMIC_FTRACE=y
CONFIG_DYNAMIC_FTRACE_WITH_REGS=y

6357a6363

Quoted 1 line

CONFIG_FTRACE_MCOUNT_RECORD=y

Regards,
S.Ancelot

_______________________________________________
Xenomai mailing list
[email protected]
https://xenomai.org/mailman/listinfo/xenomai