[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Query on memory management
Andi Kleen wrote:
> > (4) Is there a "hook" for user defined page replacement or page fault
> > handling? I could not find one.
>
> Just mprotect() the data in user space and set a signal handler for SIGSEGV
> The fault address can be read from the sigcontext_struct passed to the
> signal handler.
But note that this does not handle page faults when systems calls access
the memory. I.e. you'll get EFAULTs when you read/write/ioctl the
protected memory region instead of triggering your SEGV handler.
enjoy,
-- Jamie
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/