View topic - How to increase speed of copying memory?

How to increase speed of copying memory?

anything that doesn't fit to other groups.

Postby cdm » Sat Jan 10, 2004 7:35 am

What are you basing your expected times on? Theoretical PCI bus speed or known device speed.
cdm
QNX Master
 
Posts: 789
Joined: Fri Jul 05, 2002 9:38 am

Postby xuyong » Sat Jan 10, 2004 11:31 am

somebody tell me that the tranfer time on pci bus is very fast,for 9600 byte data,3ms can't be accepted,something must be wrong in my programme.
xuyong
Senior Member
 
Posts: 431
Joined: Sun Mar 02, 2003 7:52 am

Postby bjchip » Sun Jan 11, 2004 11:43 pm

Theoretically an unloaded PCI bus should give him about 160 uSec for that sized block, but that ONLY applies to block DMA access (assuming about 60 MBytes/Sec not the 80 quoted in the spec). For async transfer, which is what happens by default, 3.2 mSec is an approximate time. Sounds VERY like someone has to do DMA transfers.

respectfully
BJ
bjchip
Active Member
 
Posts: 46
Joined: Wed Nov 26, 2003 10:20 pm

Postby mario » Mon Jan 12, 2004 6:08 pm

xuyong wrote:somebody tell me that the tranfer time on pci bus is very fast,for 9600 byte data,3ms can't be accepted,something must be wrong in my programme.


That shows that when you ask for help give as much information as possible as to what you are doing or trying to do. Everybody here would have been able to inform you that 3ms and 9600 bytes don't make sense ;-)
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby xuyong » Tue Jan 13, 2004 1:54 am

I want to use dma transfer to improve it,but how to use dma and what't the principle under qnx,sorry,
I know very little about it,please tell me the step.
xuyong
Senior Member
 
Posts: 431
Joined: Sun Mar 02, 2003 7:52 am

Postby mario » Tue Jan 13, 2004 8:23 pm

Basicaly you create a share memory that's DMA'able (check the doc) (shm_open/mmap) and you get the physical address of that memory and you set the hardware accordingly. Since you seems to already be able to talk to the hardware I'm assuming you got that part setup. How to enable DMA is dependant on the PCI card. DMA (if available) is driven by the PCI card and NOT by the PC, hence each PCI card has its own way of dealing with DMA. You will have to read through your card's manual to get the info how to set it up (register and all)

If it takes 3ms to read 9600 bytes of data (about 3M/sec) something is broken and I don't feel DMA is a solution.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby rick » Tue Jan 13, 2004 10:35 pm

Another thought - how are you getting these timings? An oscilloscope watching the bus? Also it may be worth while using the intstrumented kernel and seening exactly what is going on at the time in question.
rick
QNX Master
 
Posts: 500
Joined: Wed Nov 13, 2002 3:59 am

Postby bjchip » Tue Jan 13, 2004 11:04 pm

Mario

Nothing else needs to be broken. Without DMA on the standard 33 MHz PCI bus the transfers break down to about 3.4 MB/Sec. It takes a LOT of handshaking to do that async stuff. Same problem on SCSI, but less likely to see it since those drivers tend to be more carefully tested. The 3 mSec corresponds well with my experience. After I enabled DMA I got 60+ MB/Sec. Different OS, but this problem is with the PCI bus itself.

respectfully
BJ
bjchip
Active Member
 
Posts: 46
Joined: Wed Nov 26, 2003 10:20 pm

Postby mario » Wed Jan 14, 2004 9:58 pm

thanks BJ, for some reason I assume the PCI bus was able to handle more data when reading from slave to master.

I tryed to find the exact number (cause I find 3.4M awfully slow) in the specs but didn't have the patience to read it all.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Previous

Return to General Programming

Who is online

Users browsing this forum: Majestic-12 [Bot] and 3 guests