Skip to contentSkip to conversation

xenomai , irq and pci

Xenomai Johann Obermayr 3 participants 9 messages Mar 5, 2014 – Mar 6, 2014 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hello,

celeron dual core with PCIe - PCI bridge
we use kernel 3.10.xx smp with (isolcpus=0)
smi is disabled.
xenomai 2.6.3

we have a pci card with a fpga (with irq) and sram.

we have 2 task running.

task0 is one high prior in primary domain on core0. this task wait for event, that is fired by fpga irq. than this task will make some pci accesses to the fpga.

the other task (task1) is a shadow task, but running in secondary domain on core 1. This task make many big memcpy to sram.

in the ipipe_handler_irq we have a function callback.
a small driver hooks to this callback add make some tracepoint into a shared memory.

with the trace we see some time a very high jitter in the ipipe_handler_irq function (around 250 us).
has anyone an explanation for this?

and a 4 byte access from task0 to fpga need more than 300us,
while task1 is writing to sram.

Thanks
Johann

#1 lore raw
Quoted 23 lines · Johann Obermayr

Hello,

celeron dual core with PCIe - PCI bridge
we use kernel 3.10.xx smp with (isolcpus=0)
smi is disabled.
xenomai 2.6.3

we have a pci card with a fpga (with irq) and sram.

we have 2 task running.

task0 is one high prior in primary domain on core0. this task wait for event, that is fired by fpga irq. than this task will make some pci accesses to the fpga.

the other task (task1) is a shadow task, but running in secondary domain on core 1.
This task make many big memcpy to sram.

in the ipipe_handler_irq we have a function callback.
a small driver hooks to this callback add make some tracepoint into a shared memory.

Quoted 6 lines

with the trace we see some time a very high jitter in the ipipe_handler_irq function (around 250 us).
has anyone an explanation for this?

and a 4 byte access from task0 to fpga need more than 300us,
while task1 is writing to sram.

Maybe the problem is the size of the PCI burst when writing to the SRAM? How large is it? If the sram is mapped with "write-combine", it will be buffered and written in large bursts. Maybe you could try mapping the sram area uncached?

Signature · 1 line
                                                                Gilles.
#2 lore raw
Quoted 28 lines · Gilles Chanteperdrix
Quoted 27 lines · Johann Obermayr

Hello,

celeron dual core with PCIe - PCI bridge
we use kernel 3.10.xx smp with (isolcpus=0)
smi is disabled.
xenomai 2.6.3

we have a pci card with a fpga (with irq) and sram.

we have 2 task running.

task0 is one high prior in primary domain on core0. this task wait for event, that is fired by fpga irq. than this task will make some pci accesses to the fpga.

the other task (task1) is a shadow task, but running in secondary domain on core 1.
This task make many big memcpy to sram.

in the ipipe_handler_irq we have a function callback.
a small driver hooks to this callback add make some tracepoint into a shared memory.

with the trace we see some time a very high jitter in the ipipe_handler_irq function (around 250 us).
has anyone an explanation for this?

Quoted 8 lines
Quoted 2 lines

and a 4 byte access from task0 to fpga need more than 300us,
while task1 is writing to sram.

Maybe the problem is the size of the PCI burst when writing to the SRAM? How large is it? If the sram is mapped with "write-combine", it will be buffered and written in large bursts. Maybe you could try mapping the sram area uncached?

Also, you do not tell us if your processor has two real cores, or if they are hyperthreaded?

Signature · 1 line
                                                                Gilles.
#3 lore raw
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines

task0 is one high prior in primary domain on core0. this task wait for event, that is fired by fpga irq. than this task will make some pci accesses to the fpga.

A while ago (11/02) you wrote to this list ('[Xenomai] Xenomai and pci access') because you had issues with PCI transfers. Did you fix those ? How large are your transfers ?

Quoted 4 lines
Quoted 3 lines

the other task (task1) is a shadow task, but running in secondary domain

Quoted 2 lines

on core 1.
This task make many big memcpy to sram.

I remember having asked for the complete PCI bus layout and to try out other memory access methods besides memcpy. Did this do anything ?

Since you mention you have an FPGA, I would now suggest instrumenting it (add some logging) as to find out when and how (regular intervals or with interruptions) your FPGA is accessed by the PCI bus.

J.

Quoted 30 lines
Quoted 6 lines
Quoted 6 lines

in the ipipe_handler_irq we have a function callback.
a small driver hooks to this callback add make some tracepoint into a shared memory.

with the trace we see some time a very high jitter in the

ipipe_handler_irq

Quoted 11 lines
Quoted 5 lines

function (around 250 us).
has anyone an explanation for this?

and a 4 byte access from task0 to fpga need more than 300us,
while task1 is writing to sram.

Maybe the problem is the size of the PCI burst when writing to the SRAM? How large is it? If the sram is mapped with "write-combine", it will be buffered and written in large bursts. Maybe you could try mapping the sram area uncached?

Also, you do not tell us if your processor has two real cores, or if they are hyperthreaded?

--
Gilles.

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

#5 lore raw
In reply to Gilles Chanteperdrix

Am 05.03.2014 17:41, schrieb Gilles Chanteperdrix:

Quoted 28 lines · Johann Obermayr
Quoted 27 lines

Hello,

celeron dual core with PCIe - PCI bridge
we use kernel 3.10.xx smp with (isolcpus=0)
smi is disabled.
xenomai 2.6.3

we have a pci card with a fpga (with irq) and sram.

we have 2 task running.

task0 is one high prior in primary domain on core0. this task wait for event, that is fired by fpga irq. than this task will make some pci accesses to the fpga.

the other task (task1) is a shadow task, but running in secondary domain on core 1.
This task make many big memcpy to sram.

in the ipipe_handler_irq we have a function callback.
a small driver hooks to this callback add make some tracepoint into a shared memory.

with the trace we see some time a very high jitter in the ipipe_handler_irq function (around 250 us).
has anyone an explanation for this?

Quoted 7 lines
Quoted 2 lines

and a 4 byte access from task0 to fpga need more than 300us,
while task1 is writing to sram.

Maybe the problem is the size of the PCI burst when writing to the SRAM? How large is it? If the sram is mapped with "write-combine", it will be buffered and written in large bursts. Maybe you could try mapping the sram area uncached?

Hi,

we use 2 real cores, no HT.
task1 do a memcpy with 10000 bytes.

For mapping we use, rtdm_iomap_to_user
rval = rtdm_iomap_to_user(user_info, lv.phys_addr, lv.len, PROT_READ | PROT_WRITE, &lv.virt_addr, NULL, NULL);

Thanks
Johann

#4 lore raw
In reply to Jeroen Van den Keybus

Am 05.03.2014 20:59, schrieb Jeroen Van den Keybus:

Quoted 7 lines
Quoted 4 lines
Quoted 4 lines

task0 is one high prior in primary domain on core0. this task wait for event, that is fired by fpga irq. than this task will make some pci accesses to the fpga.

A while ago (11/02) you wrote to this list ('[Xenomai] Xenomai and pci access') because you had issues with PCI transfers. Did you fix those ? How large are your transfers ?

The old part we have fixed. (but not very beautyful). But it work.

Our write transfer has 10kByte, and this need 1,8 ms. And our system work with 1ms ticks. That mean , our rt-task will start every 1ms.

Quoted 9 lines
Quoted 2 lines
Quoted 2 lines

the other task (task1) is a shadow task, but running in

secondary domain
>> on core 1.
>> This task make many big memcpy to sram.

I remember having asked for the complete PCI bus layout and to try out other memory access methods besides memcpy. Did this do anything ?

We can't change the memcpy function.

Quoted 2 lines

Since you mention you have an FPGA, I would now suggest instrumenting it (add some logging) as to find out when and how (regular intervals or with interruptions) your FPGA is accessed by the PCI bus.

Now we will measure all available hardware points.
FPGA output, PCI bus, PCIe ??, and than the interrupt line to the core.

#6 lore raw
In reply to Johann Obermayr
Quoted 36 lines · Johann Obermayr

Am 05.03.2014 17:41, schrieb Gilles Chanteperdrix:

Quoted 28 lines · Johann Obermayr
Quoted 27 lines

Hello,

celeron dual core with PCIe - PCI bridge
we use kernel 3.10.xx smp with (isolcpus=0)
smi is disabled.
xenomai 2.6.3

we have a pci card with a fpga (with irq) and sram.

we have 2 task running.

task0 is one high prior in primary domain on core0. this task wait for event, that is fired by fpga irq. than this task will make some pci accesses to the fpga.

the other task (task1) is a shadow task, but running in secondary domain on core 1.
This task make many big memcpy to sram.

in the ipipe_handler_irq we have a function callback.
a small driver hooks to this callback add make some tracepoint into a shared memory.

with the trace we see some time a very high jitter in the ipipe_handler_irq function (around 250 us).
has anyone an explanation for this?

Quoted 7 lines
Quoted 2 lines

and a 4 byte access from task0 to fpga need more than 300us,
while task1 is writing to sram.

Maybe the problem is the size of the PCI burst when writing to the SRAM? How large is it? If the sram is mapped with "write-combine", it will be buffered and written in large bursts. Maybe you could try mapping the sram area uncached?

Quoted 4 lines

Hi,

we use 2 real cores, no HT.
task1 do a memcpy with 10000 bytes.

have you tried splitting the copy in smaller chunks, and use a mutex for exclusion between the two threads?

Quoted 4 lines

For mapping we use, rtdm_iomap_to_user
rval = rtdm_iomap_to_user(user_info, lv.phys_addr, lv.len, PROT_READ | PROT_WRITE, &lv.virt_addr, NULL, NULL);

You may want to try the following patch:

http://git.xenomai.org/xenomai-2.6.git/commit/?id=1b8fb14e486ac0604e44067a0f1f89dc14153e95

Signature · 1 line
                                                                Gilles.
#7 lore raw

Am 06.03.2014 20:20, schrieb Gilles Chanteperdrix:

Quoted 37 lines · Johann Obermayr
Quoted 36 lines

Am 05.03.2014 17:41, schrieb Gilles Chanteperdrix:

Quoted 35 lines · Johann Obermayr
Quoted 23 lines

Hello,

celeron dual core with PCIe - PCI bridge
we use kernel 3.10.xx smp with (isolcpus=0)
smi is disabled.
xenomai 2.6.3

we have a pci card with a fpga (with irq) and sram.

we have 2 task running.

task0 is one high prior in primary domain on core0. this task wait for event, that is fired by fpga irq. than this task will make some pci accesses to the fpga.

the other task (task1) is a shadow task, but running in secondary domain on core 1.
This task make many big memcpy to sram.

in the ipipe_handler_irq we have a function callback.
a small driver hooks to this callback add make some tracepoint into a shared memory.

Quoted 6 lines

with the trace we see some time a very high jitter in the ipipe_handler_irq function (around 250 us).
has anyone an explanation for this?

and a 4 byte access from task0 to fpga need more than 300us,
while task1 is writing to sram.

Maybe the problem is the size of the PCI burst when writing to the SRAM? How large is it? If the sram is mapped with "write-combine", it will be buffered and written in large bursts. Maybe you could try mapping the sram area uncached?

Quoted 6 lines
Quoted 4 lines

Hi,

we use 2 real cores, no HT.
task1 do a memcpy with 10000 bytes.

have you tried splitting the copy in smaller chunks, and use a mutex for exclusion between the two threads?

That can we do.
Only in our testsystem, but in customer application, we have no way to change this.

Quoted 8 lines
Quoted 3 lines

For mapping we use, rtdm_iomap_to_user
rval = rtdm_iomap_to_user(user_info, lv.phys_addr, lv.len, PROT_READ | PROT_WRITE, &lv.virt_addr, NULL, NULL);

You may want to try the following patch:

http://git.xenomai.org/xenomai-2.6.git/commit/?id=1b8fb14e486ac0604e44067a0f1f89dc14153e95

we will test this.

Thanks,
Johann

#10 lore raw
In reply to a message not in the archive

Am 06.03.2014 20:46, schrieb Gilles Chanteperdrix:

Quoted 43 lines · Johann Obermayr
Quoted 42 lines

Am 06.03.2014 20:20, schrieb Gilles Chanteperdrix:

Quoted 41 lines · Johann Obermayr
Quoted 40 lines

Am 05.03.2014 17:41, schrieb Gilles Chanteperdrix:

Quoted 28 lines · Johann Obermayr
Quoted 27 lines

Hello,

celeron dual core with PCIe - PCI bridge
we use kernel 3.10.xx smp with (isolcpus=0)
smi is disabled.
xenomai 2.6.3

we have a pci card with a fpga (with irq) and sram.

we have 2 task running.

task0 is one high prior in primary domain on core0. this task wait for event, that is fired by fpga irq. than this task will make some pci accesses to the fpga.

the other task (task1) is a shadow task, but running in secondary domain on core 1.
This task make many big memcpy to sram.

in the ipipe_handler_irq we have a function callback.
a small driver hooks to this callback add make some tracepoint into a shared memory.

with the trace we see some time a very high jitter in the ipipe_handler_irq function (around 250 us).
has anyone an explanation for this?

Quoted 7 lines
Quoted 2 lines

and a 4 byte access from task0 to fpga need more than 300us,
while task1 is writing to sram.

Maybe the problem is the size of the PCI burst when writing to the SRAM? How large is it? If the sram is mapped with "write-combine", it will be buffered and written in large bursts. Maybe you could try mapping the sram area uncached?

Hi,

we use 2 real cores, no HT.
task1 do a memcpy with 10000 bytes.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

have you tried splitting the copy in smaller chunks, and use a mutex for exclusion between the two threads?

That can we do.
Only in our testsystem, but in customer application, we have no way to change this.

Ok, I suppose you can change the FPGA then? Have you tried to make the BAR with the SRAM appear as register intead of memory?

i'll talk to the fpga department.