Subject: Re: Measuring memory to memory copy operations (+ interrupts, DMA)
To: <>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 08/22/2003 19:56:24
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.

> (I'm inclined to agree with the "shouldn't be trying to" apart; ISTM
> this belongs in or near the proc struct, with added facilities
> (sysctl? pseudo-device?) to allow userland to get it when desired.)

Or something like what UW2 (and solaris?) does to mmap /dev/time (or similar)
so that gettimeofday (and a few other calls) don't have to be system calls.
I think wine could do with something like that in order to correctly
emulate the behaviour of windows.

	David

-- 
David Laight: david@l8s.co.uk