Re: can application find out the physical address of it's buffer ?



Andray Kaganovsky <andrayk@xxxxxxxxxxx> wrote:
...
I am writing user-space application, and I need to allocate moderately
sized (few KBytes) buffer in such a way that my application knows
which physical address the allocated buffer resides at.

The related question is, how can I lock the allocated buffer in RAM
so that it will not be swapped out when my application exhaust it's
time slice and is scheduled off the CPU, and will still be at
the same physical address when my application will get back on the
CPU.

I would work on the opposite direction: Reserve an area in physical
memory for your buffer, and map it into the application's virtual
memory using mmap().
The first step could be done by telling the kernel that it has less
memory than what is physically available and using areas beyond that
value for the buffer.


Roberto Waltman

[ Please reply to the group,
return address is invalid ]
.



Relevant Pages

  • Re: read vs. mmap (or io vs. page faults)
    ... not fit in main memory, and there are overheads related to the heuristics ... But because the CPU is underutilized, ... reasonably sized user buffer). ... You have to measure the actual overhead to see what the actual cost is. ...
    (freebsd-questions)
  • Cache coherency issues using AllocateCommonBuffer(..)
    ... I am seeing a cache coherency issue with memory allocated through ... The application I am running is in a dual host enviornment, ... from its shared memory buffer, is stale, i.e. cached data. ... drivet I allocate with the following call: ...
    (microsoft.public.development.device.drivers)
  • Re: Real World Significant Sources of (what we usually call) Latency
    ... faster CPU, more RAM, and tweaking actually help to reduce latency? ... you can reduce your buffer size to half." ... memory will have little additional benefit. ...
    (rec.audio.pro)
  • Re: 1G DMA buffer under XP - how?
    ... system memory, and what is address 0 to the controller could be something ... so only the HAL's DMA routines can allocate ... common buffer correctly in all situations. ... My card is happy with any physical address> below 4G, and I can tell this call to only allocate below the given> HighestAcceptableAddress. ...
    (microsoft.public.development.device.drivers)
  • Re: 32-bit dma allocations on 64-bit platforms
    ... relies on swiotlb for em64t systems. ... needs (more on our memory usage shortly). ... the swiotlb code throwing a kernel panic when it can't allocate ... ~64k for X's push buffer and ~1M per opengl client for their push ...
    (Linux-Kernel)