public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* high-order allocation + highmem + streaming DMA - possible?
@ 2011-10-19  6:45 Nikita V. Youshchenko
  2011-10-19 10:24 ` RKK
  0 siblings, 1 reply; 3+ messages in thread
From: Nikita V. Youshchenko @ 2011-10-19  6:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: stefan

Hello.

We are writing a driver for a custom PCI device that receives large amount 
of data.

Device is capable of DMAing received data in 64k chunks.

We have been going to:
- use physically-continuous 64k-sized memory areas using alloc_pages() with 
order=4,
- allocate large number of such areas on driver init,
- implement mmap() to map those all to userspace for zero-copy processing,
- use streaming DMA to actually receive data

However I can't find a way to use streaming DMA for large highmem areas.
- pci_map_single() is for linear mapping and can't work with highmem
- pci_map_page() can work with highmem but is limited to one page
- pci_map_sg() is for s/g lists, not for single 64k blocks.

Is there a way to use streaming DMA with large memory areas located in 
highmem?
Or in this situation buffers in highmem can't be used?

Nikita

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: high-order allocation + highmem + streaming DMA - possible?
  2011-10-19  6:45 high-order allocation + highmem + streaming DMA - possible? Nikita V. Youshchenko
@ 2011-10-19 10:24 ` RKK
  2011-10-19 10:55   ` Nikita V. Youshchenko
  0 siblings, 1 reply; 3+ messages in thread
From: RKK @ 2011-10-19 10:24 UTC (permalink / raw)
  To: Nikita V. Youshchenko; +Cc: linux-kernel, stefan

Hi Nikita

On Wed, Oct 19, 2011 at 12:15 PM, Nikita V. Youshchenko <yoush@cs.msu.su> wrote:
> Hello.
>
> We are writing a driver for a custom PCI device that receives large amount
> of data.
>
> Device is capable of DMAing received data in 64k chunks.
>
> We have been going to:
> - use physically-continuous 64k-sized memory areas using alloc_pages() with
> order=4,
> - allocate large number of such areas on driver init,
> - implement mmap() to map those all to userspace for zero-copy processing,
> - use streaming DMA to actually receive data
  May i know why u want to mmap to userspace instead of using a
device? performance is affected by a large amount if u use mmap
> However I can't find a way to use streaming DMA for large highmem areas.
> - pci_map_single() is for linear mapping and can't work with highmem
> - pci_map_page() can work with highmem but is limited to one page
> - pci_map_sg() is for s/g lists, not for single 64k blocks.
>
> Is there a way to use streaming DMA with large memory areas located in
> highmem?
I dont think DMA is available for highmem? Not sure though . never saw
a usecase for it.
> Or in this situation buffers in highmem can't be used?
>



-- 
Warm Regards,
Ravi .

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: high-order allocation + highmem + streaming DMA - possible?
  2011-10-19 10:24 ` RKK
@ 2011-10-19 10:55   ` Nikita V. Youshchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Nikita V. Youshchenko @ 2011-10-19 10:55 UTC (permalink / raw)
  To: RKK; +Cc: linux-kernel, stefan

> > Hello.
> >
> > We are writing a driver for a custom PCI device that receives large
> > amount of data.
> >
> > Device is capable of DMAing received data in 64k chunks.
> >
> > We have been going to:
> > - use physically-continuous 64k-sized memory areas using alloc_pages()
> > with order=4,
> > - allocate large number of such areas on driver init,
> > - implement mmap() to map those all to userspace for zero-copy
> > processing, - use streaming DMA to actually receive data
>
>   May i know why u want to mmap to userspace instead of using a
> device? performance is affected by a large amount if u use mmap

mmap() is done once, at initialization time, for entire data buffer.
Later data is processed in zero-copy pattern.
I believe it is fastest possible solution.

> > Is there a way to use streaming DMA with large memory areas located in
> > highmem?
>
> I dont think DMA is available for highmem? Not sure though . never saw
> a usecase for it.

DMA is definitly available for highmem on per-page basis.
I'm interested in DMA of larger blocks.

Nikita

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-19 10:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-19  6:45 high-order allocation + highmem + streaming DMA - possible? Nikita V. Youshchenko
2011-10-19 10:24 ` RKK
2011-10-19 10:55   ` Nikita V. Youshchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox