Skip to contentSkip to conversation

XENO_OPT_SYS_STACKPOOLSZ vs. switchtest

Xenomai-core Jan Kiszka 3 participants 14 messages Feb 19, 2009

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Hi Gilles,

how much XENO_OPT_SYS_STACKPOOLSZ do I need to run switchtest for default settings? At least on x86-64, the default 32K is not enough. Unless we talk about GB ;), maybe it makes sense to adjust the default size accordingly.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#1 lore raw
Quoted 6 lines · Jan Kiszka

Hi Gilles,

how much XENO_OPT_SYS_STACKPOOLSZ do I need to run switchtest for default settings? At least on x86-64, the default 32K is not enough. Unless we talk about GB ;), maybe it makes sense to adjust the default size accordingly.

It depends on the arguments you pass to switchtest.

Signature · 1 line
                                                 Gilles.
author
#2 lore raw
Quoted 9 lines · Gilles Chanteperdrix
Quoted 6 lines · Jan Kiszka

Hi Gilles,

how much XENO_OPT_SYS_STACKPOOLSZ do I need to run switchtest for default settings? At least on x86-64, the default 32K is not enough. Unless we talk about GB ;), maybe it makes sense to adjust the default size accordingly.

It depends on the arguments you pass to switchtest.

None, ie. the default settings.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#3 lore raw
Quoted 11 lines · Jan Kiszka
Quoted 8 lines · Gilles Chanteperdrix
Quoted 6 lines · Jan Kiszka

Hi Gilles,

how much XENO_OPT_SYS_STACKPOOLSZ do I need to run switchtest for default settings? At least on x86-64, the default 32K is not enough. Unless we talk about GB ;), maybe it makes sense to adjust the default size accordingly.

It depends on the arguments you pass to switchtest.

None, ie. the default settings.

Then 6 kernel-space tasks are created. Since switchtest is not the average use of Xenomai, and is supposed to be used only for validating the context/FPU switches, I would not change XENO_OPT_SYS_STACKPOOL_SZ, maybe only add a clear message when creation of kernel-space tasks fails.

Signature · 1 line
                                                 Gilles.
author
#4 lore raw
Quoted 5 lines · Gilles Chanteperdrix
Quoted 4 lines · Jan Kiszka
Quoted 3 lines · Gilles Chanteperdrix
Quoted 2 lines · Jan Kiszka

Hi Gilles,

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

how much XENO_OPT_SYS_STACKPOOLSZ do I need to run switchtest for default settings? At least on x86-64, the default 32K is not enough. Unless we talk about GB ;), maybe it makes sense to adjust the default size accordingly.

It depends on the arguments you pass to switchtest.

None, ie. the default settings.

Then 6 kernel-space tasks are created. Since switchtest is not the

6*4 is 20k... Ah, the well-known allocator overhead, I guess. Will try with >= 40k.

Quoted 3 lines

average use of Xenomai, and is supposed to be used only for validating the context/FPU switches, I would not change XENO_OPT_SYS_STACKPOOL_SZ, maybe only add a clear message when creation of kernel-space tasks fails.

Well, isn't the switchtest part of xeno-test? Would be unfortunate to require a kernel rebuild just for running the standard tests. I think we don't loose much by slightly increasing the stack to, say, 64K on 32 bit and 128K on 64 bit archs.

BTW, XNARCH_THREAD_STACKSZ for x86-64 equals the x86-32 bit value (4K) while I don't think the have they same demands (nor the same resource restrictions).

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#5 lore raw
Quoted 17 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
Quoted 4 lines · Jan Kiszka
Quoted 3 lines · Gilles Chanteperdrix
Quoted 2 lines · Jan Kiszka

Hi Gilles,

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

how much XENO_OPT_SYS_STACKPOOLSZ do I need to run switchtest for default settings? At least on x86-64, the default 32K is not enough. Unless we talk about GB ;), maybe it makes sense to adjust the default size accordingly.

It depends on the arguments you pass to switchtest.

None, ie. the default settings.

Then 6 kernel-space tasks are created. Since switchtest is not the

6*4 is 20k... Ah, the well-known allocator overhead, I guess. Will try with >= 40k.

Quoted 8 lines
Quoted 3 lines

average use of Xenomai, and is supposed to be used only for validating the context/FPU switches, I would not change XENO_OPT_SYS_STACKPOOL_SZ, maybe only add a clear message when creation of kernel-space tasks fails.

Well, isn't the switchtest part of xeno-test? Would be unfortunate to require a kernel rebuild just for running the standard tests. I think we don't loose much by slightly increasing the stack to, say, 64K on 32 bit and 128K on 64 bit archs.

The kernel rebuild is already required since the switchtest driver is not compiled by default.

Signature · 1 line
                                                 Gilles.
author
#6 lore raw
Quoted 20 lines · Gilles Chanteperdrix
Quoted 19 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
Quoted 4 lines · Jan Kiszka
Quoted 3 lines · Gilles Chanteperdrix
Quoted 2 lines · Jan Kiszka

Hi Gilles,

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

how much XENO_OPT_SYS_STACKPOOLSZ do I need to run switchtest for default settings? At least on x86-64, the default 32K is not enough. Unless we talk about GB ;), maybe it makes sense to adjust the default size accordingly.

It depends on the arguments you pass to switchtest.

None, ie. the default settings.

Then 6 kernel-space tasks are created. Since switchtest is not the

6*4 is 20k... Ah, the well-known allocator overhead, I guess. Will try with >= 40k.

Quoted 3 lines

average use of Xenomai, and is supposed to be used only for validating the context/FPU switches, I would not change XENO_OPT_SYS_STACKPOOL_SZ, maybe only add a clear message when creation of kernel-space tasks fails.

Quoted 7 lines
Quoted 4 lines

Well, isn't the switchtest part of xeno-test? Would be unfortunate to require a kernel rebuild just for running the standard tests. I think we don't loose much by slightly increasing the stack to, say, 64K on 32 bit and 128K on 64 bit archs.

The kernel rebuild is already required since the switchtest driver is not compiled by default.

Even if it were default off (which it isn't), requiring a second rebuild due to this implicit dependency would remain, well, unfortunate.

I will propose a Kconfig adjustment later.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#7 lore raw
In reply to Jan Kiszka
Quoted 10 lines · Jan Kiszka
Quoted 9 lines · Gilles Chanteperdrix
Quoted 8 lines · Jan Kiszka
Quoted 7 lines · Gilles Chanteperdrix
Quoted 6 lines · Jan Kiszka

Hi Gilles,

how much XENO_OPT_SYS_STACKPOOLSZ do I need to run switchtest for default settings? At least on x86-64, the default 32K is not enough. Unless we talk about GB ;), maybe it makes sense to adjust the default size accordingly.

Quoted 7 lines
Quoted 3 lines
Quoted 2 lines
Quoted 1 line

It depends on the arguments you pass to switchtest.

None, ie. the default settings.

Then 6 kernel-space tasks are created. Since switchtest is not the

6*4 is 20k... Ah, the well-known allocator overhead, I guess. Will try with >= 40k.

Actually, it is not really an overhead, but rather the fact that it wants at least two initially free pages per heap.

Quoted 15 lines
Quoted 3 lines

average use of Xenomai, and is supposed to be used only for validating the context/FPU switches, I would not change XENO_OPT_SYS_STACKPOOL_SZ, maybe only add a clear message when creation of kernel-space tasks fails.

Well, isn't the switchtest part of xeno-test? Would be unfortunate to require a kernel rebuild just for running the standard tests. I think we don't loose much by slightly increasing the stack to, say, 64K on 32 bit and 128K on 64 bit archs.

BTW, XNARCH_THREAD_STACKSZ for x86-64 equals the x86-32 bit value (4K) while I don't think the have they same demands (nor the same resource restrictions).

Jan

Signature · 1 line
Philippe.
author
#8 lore raw
Quoted 12 lines · Philippe Gerum
Quoted 11 lines · Jan Kiszka
Quoted 10 lines · Gilles Chanteperdrix
Quoted 9 lines · Jan Kiszka
Quoted 8 lines · Gilles Chanteperdrix
Quoted 6 lines · Jan Kiszka

Hi Gilles,

how much XENO_OPT_SYS_STACKPOOLSZ do I need to run switchtest for default settings? At least on x86-64, the default 32K is not enough. Unless we talk about GB ;), maybe it makes sense to adjust the default size accordingly.

It depends on the arguments you pass to switchtest.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Quoted 1 line

None, ie. the default settings.

Then 6 kernel-space tasks are created. Since switchtest is not the

6*4 is 20k... Ah, the well-known allocator overhead, I guess. Will try with >= 40k.

Actually, it is not really an overhead, but rather the fact that it wants at least two initially free pages per heap.

That would make 22K. The problem is that the management overhead is rounded up to another full page, requiring a 8K allocation per 4K request. Reminds me of TLSF - if I only had the time... :)

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#9 lore raw
Quoted 18 lines · Jan Kiszka
Quoted 17 lines · Philippe Gerum
Quoted 16 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
Quoted 4 lines · Jan Kiszka
Quoted 3 lines · Gilles Chanteperdrix
Quoted 2 lines · Jan Kiszka

Hi Gilles,

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

how much XENO_OPT_SYS_STACKPOOLSZ do I need to run switchtest for default settings? At least on x86-64, the default 32K is not enough. Unless we talk about GB ;), maybe it makes sense to adjust the default size accordingly.

It depends on the arguments you pass to switchtest.

None, ie. the default settings.

Then 6 kernel-space tasks are created. Since switchtest is not the

6*4 is 20k... Ah, the well-known allocator overhead, I guess. Will try with >= 40k.

Quoted 6 lines
Quoted 2 lines

Actually, it is not really an overhead, but rather the fact that it wants at least two initially free pages per heap.

That would make 22K. The problem is that the management overhead is rounded up to another full page, requiring a 8K allocation per 4K request. Reminds me of TLSF - if I only had the time... :)

When allocating 4K, only 4K are allocated.

I think the problem could rather be that you are running switchtest on a multi-cpu system, in which same the number of cpu tasks created is 6 by cpu.

Signature · 1 line
                                                 Gilles.
author
#10 lore raw
Quoted 21 lines · Gilles Chanteperdrix
Quoted 20 lines · Jan Kiszka
Quoted 19 lines · Philippe Gerum
Quoted 10 lines · Jan Kiszka
Quoted 9 lines · Gilles Chanteperdrix
Quoted 8 lines · Jan Kiszka
Quoted 7 lines · Gilles Chanteperdrix
Quoted 6 lines · Jan Kiszka

Hi Gilles,

how much XENO_OPT_SYS_STACKPOOLSZ do I need to run switchtest for default settings? At least on x86-64, the default 32K is not enough. Unless we talk about GB ;), maybe it makes sense to adjust the default size accordingly.

Quoted 6 lines
Quoted 3 lines
Quoted 2 lines
Quoted 1 line

It depends on the arguments you pass to switchtest.

None, ie. the default settings.

Then 6 kernel-space tasks are created. Since switchtest is not the

6*4 is 20k... Ah, the well-known allocator overhead, I guess. Will try with >= 40k.

Actually, it is not really an overhead, but rather the fact that it wants at least two initially free pages per heap.

Quoted 8 lines
Quoted 3 lines

That would make 22K. The problem is that the management overhead is rounded up to another full page, requiring a 8K allocation per 4K request. Reminds me of TLSF - if I only had the time... :)

When allocating 4K, only 4K are allocated.

I think the problem could rather be that you are running switchtest on a multi-cpu system, in which same the number of cpu tasks created is 6 by cpu.

That was in fact the problem here. OK, so we should just consider adjusting the pool default for 8K-stack archs (PowerPC64, Blackfin, and maybe also x86-64).

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#11 lore raw
In reply to Jan Kiszka
Quoted 18 lines · Jan Kiszka
Quoted 17 lines · Philippe Gerum
Quoted 16 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
Quoted 4 lines · Jan Kiszka
Quoted 3 lines · Gilles Chanteperdrix
Quoted 2 lines · Jan Kiszka

Hi Gilles,

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

how much XENO_OPT_SYS_STACKPOOLSZ do I need to run switchtest for default settings? At least on x86-64, the default 32K is not enough. Unless we talk about GB ;), maybe it makes sense to adjust the default size accordingly.

It depends on the arguments you pass to switchtest.

None, ie. the default settings.

Then 6 kernel-space tasks are created. Since switchtest is not the

6*4 is 20k... Ah, the well-known allocator overhead, I guess. Will try with >= 40k.

Quoted 6 lines
Quoted 2 lines

Actually, it is not really an overhead, but rather the fact that it wants at least two initially free pages per heap.

That would make 22K. The problem is that the management overhead is rounded up to another full page, requiring a 8K allocation per 4K request.

Nope. An individual 4k request is going to pull 8 x 512 bytes pages from the stack pool, not more.

Reminds me of TLSF - if I only had the time... :)

Quoted 1 line

It looks like working properly for -solo.

Quoted 2 lines

Jan

Signature · 1 line
Philippe.
author
#12 lore raw
Quoted 19 lines · Philippe Gerum
Quoted 18 lines · Jan Kiszka
Quoted 17 lines · Philippe Gerum
Quoted 16 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
Quoted 4 lines · Jan Kiszka
Quoted 3 lines · Gilles Chanteperdrix
Quoted 2 lines · Jan Kiszka

Hi Gilles,

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

how much XENO_OPT_SYS_STACKPOOLSZ do I need to run switchtest for default settings? At least on x86-64, the default 32K is not enough. Unless we talk about GB ;), maybe it makes sense to adjust the default size accordingly.

It depends on the arguments you pass to switchtest.

None, ie. the default settings.

Then 6 kernel-space tasks are created. Since switchtest is not the

6*4 is 20k... Ah, the well-known allocator overhead, I guess. Will try with >= 40k.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Actually, it is not really an overhead, but rather the fact that it wants at least two initially free pages per heap.

That would make 22K. The problem is that the management overhead is rounded up to another full page, requiring a 8K allocation per 4K request.

Nope. An individual 4k request is going to pull 8 x 512 bytes pages from the stack pool, not more.

Yeah, I see. The only "overhead" here was already paid via the pagemap.

Quoted 4 lines

Reminds me of TLSF - if I only had the time... :)

It looks like working properly for -solo.

I think to remember your concerns were more about missing fragmentation, size overhead and performance comparisons. A working version for standard Xenomai was already available at that time (maybe not for all archs, but that is surely quickly fixed).

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#13 lore raw
Quoted 30 lines · Jan Kiszka
Quoted 19 lines · Philippe Gerum
Quoted 18 lines · Jan Kiszka
Quoted 17 lines · Philippe Gerum
Quoted 16 lines · Jan Kiszka
Quoted 5 lines · Gilles Chanteperdrix
Quoted 4 lines · Jan Kiszka
Quoted 3 lines · Gilles Chanteperdrix
Quoted 2 lines · Jan Kiszka

Hi Gilles,

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines

how much XENO_OPT_SYS_STACKPOOLSZ do I need to run switchtest for default settings? At least on x86-64, the default 32K is not enough. Unless we talk about GB ;), maybe it makes sense to adjust the default size accordingly.

It depends on the arguments you pass to switchtest.

None, ie. the default settings.

Then 6 kernel-space tasks are created. Since switchtest is not the

6*4 is 20k... Ah, the well-known allocator overhead, I guess. Will try with >= 40k.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Actually, it is not really an overhead, but rather the fact that it wants at least two initially free pages per heap.

That would make 22K. The problem is that the management overhead is rounded up to another full page, requiring a 8K allocation per 4K request.

Nope. An individual 4k request is going to pull 8 x 512 bytes pages from the stack pool, not more.

Yeah, I see. The only "overhead" here was already paid via the pagemap.

Quoted 9 lines
Quoted 3 lines

Reminds me of TLSF - if I only had the time... :)

It looks like working properly for -solo.

I think to remember your concerns were more about missing fragmentation, size overhead and performance comparisons. A working version for standard Xenomai was already available at that time (maybe not for all archs, but that is surely quickly fixed).

Locking and init fixes went to TLSF 2.4.4 in the recent months, so we would have needed those anyway. It's quite late to merge TLSF in Xenomai 2.5, but I would have no objection to make it the base allocator of the 3.x series. We would have to extend it with:

- support for a few callouts, such as the validity checking function used in xnhead_test_and_free(),
- shared memory export (this is quite allocator agnostic in fact)
- detailed error codes in xnheap_test_and_free/xnheap_free

Quoted 2 lines

Jan

Signature · 1 line
Philippe.