[openib-general] Question about pinning memory

Gleb Natapov glebn at voltaire.com
Tue Jul 26 00:05:23 PDT 2005


On Mon, Jul 25, 2005 at 09:47:59AM -0700, Roland Dreier wrote:
>     Gleb> Can you elaborate on kernel upcalls mechanism?
> 
> Not sure what you mean by the question.  I was just trying to say that
> in general when the kernel has some information it wants to push to
> userspace, it's probably best for userspace to get it via a read() on
> a file descriptor rather than for the kernel to queue a signal.
> 
This is what Pete did. We are back to on syscall on each registration.
And the worst case is three syscalls. First to check that mapping is valid,
second to deregister memory if it is not and third register new memory.

>     Gleb> This is responsibility of the user to make sure he is not
>     Gleb> unmaps or frees memory that is currently in use.
> 
> Any registration caching scheme has to deal with a user using memory
> X, freeing memory X, and then allocating memory Y at the same virtual
> address as X.
> 
Not exactly. When user frees memory by calling free() the memory is not
unmapped from process address space by libc. We want to cache the
registrations in this memory. We don't want to cache registration
across mmap/munmap/mmap (it is much harder to do if at all possible).
When libc unmaps memory by sbrk() or munmap the memory guaranteed to be
not used by correct program so it is safe to deregister it if we catch 
this event.

--
			Gleb.



More information about the general mailing list