Question on memory management

From: Jan Evert van Grootheest (
Date: Wed May 24 2000 - 09:36:19 EST


I'm writing a driver and the related user application for a specific
device. The system is only used to handle data from this device in a
highly controlled environment, so the reasoning behind decisions is
sometimes a bit different from the `general use' case. I'm using 2.2.14

Specifically, I'd like the driver to pass some information to the app
(and back) without using system calls. For this a few pages of memory
have been reserved using __get_free_pages( GFP_KERNEL ). However, I
don't know enough of the VM system to find the best way to get the app
to see these pages of memory.
The pages need to be available to the interrupt and bottom-half handler
of the driver AND to the app. The app needs write access to only one of
the pages, all the others are read-only.
What would be the most effective way to do this?
The mmap() system call seems to be the way for the app to do this, since
it knows the information it needs to use it. But I'm not sure how to
implement the mmap file operation on the driver side.
And there's only one app using the driver and needing the shared pages
(if that's of any relevance).

A second question is if the page could possibly be swapped out. I'd like
(perhaps need) to prevent that from happening. Would PG_locked do the
trick here?

Thanks already,
Jan Evert

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:11 EST