Subject: Re: Measuring memory to memory copy operations (+ interrupts, DMA)
To: None <tech-kern@netbsd.org>
From: Kamal R Prasad <kamalrpr@in.ibm.com>
List: tech-kern
Date: 08/26/2003 14:19:32
-------
On Fri, Aug 22, 2003 at 02:27:08PM -0400, der Mouse wrote:
> >> how does one pin dynamically allocated memory in libc (so that it
> >> could be used by an interrupt handler)?
> > You can't, and shouldn't be trying to.
>
> Can't? Isn't that what mlock() does?
>That will lock the memory backing the user processes virtual address,
>doesn't mean you can access it from a random routine that isn't
>running in the context of the relevant process.
>I even think that mlock() will just guarantee than copy{in,out}()
>won't block - you still have to use the functions.
>It looks like what you are saying is true. AIX has a function inside the
>kernel which pins user memory ie we are not supposed to use mlock() for
>this purpose.
There is an equivalent call to mlock() on AIX -pin() which does the job of
making it non-pageable. You do need to use copyin() over the pinned memory
-as you have pointed out.
regards
-kamal
--
David Laight: david@l8s.co.uk