PCI bus-master and large contiguous memory buffers
- From: v_mirgorodsky@xxxxxxxxx
- Date: 9 Feb 2006 08:34:15 -0800
Hello, ALL!
I am developing PCI bus-master device, which generates a lot of data
during its life-time. On average device generates about 85-100MB of
data per second. Since the amount of data is huge, I need relatively
large 32MB contiguous memory buffer, which is a big problem in modern
OS. After getting these data from device driver needs to perform some
small processing, like adding headers, cross-references, etc. Driver
restricts its use by more than single application at a time, at least
on data interface.
I can not follow standard DMA-like procedure when talking to device,
since it requires extremely low latency in data handling. I can not
have several small contiguous memory buffers since the data comes out
in a big bursts and device may already overwrite the data in such
buffer while OS not yet managed to invoke my DPC for ISR.
I would like to adopt the following solution for this task. First of
all user application allocates any size of buffer it desires and
notifies the driver about its starting address. Driver rounds the
buffer start address to the beginning of the physical page size (may be
even run-time configuration parameter) and maps the entire buffer into
kernel memory space and protects it from being paged out by memory
paging system. Then driver allocates a small amount of contiguous
non-paged memory, like 64kB or so and fills it with 4-bytes long
addresses of physical pages of memory, from which the user buffer
consists. That is all. As soon device needs next portion of physical
memory to store the data it just reads its address from the catalog. At
the end of the buffer it wraps to its beginning. As soon as new portion
of data ready, device generates the interrupt to notify driver about
this. Buffer may be allocated once and may be used as long as it locked
in kernel memory space. In the end of session driver deconfigures
device, unmaps user buffer, etc.
Are there any serious pitfalls with this approach I am not aware of? Is
there documented way to get the list of pages user buffer consists of?
Will the OS try to exchange one page to another while it locked in
memory?
With best regards,
Vladimir S. Mirgorodsky
.
- Follow-Ups:
- Re: PCI bus-master and large contiguous memory buffers
- From: Maxim S. Shatskih
- Re: PCI bus-master and large contiguous memory buffers
- Prev by Date: Re: newbie: Spinlocks and calls
- Next by Date: 1394 driver - WHQL
- Previous by thread: Re: newbie: Spinlocks and calls
- Next by thread: Re: PCI bus-master and large contiguous memory buffers
- Index(es):
Relevant Pages
|
Loading