The HyperNews Linux KHG Discussion Pages

Question: Linux Memory Management

Forum: Device Drivers
Keywords: I/O driver paging
Date: Wed, 25 Jun 1997 20:18:53 GMT
From: Dean Kinard <kinard@intellistor.com>

I am writing a character device driver and have a few questions regarding Linux's memory management.

The user's process will issue an IOCTL operation to my driver, and will provide a memory address to a buffer in the user's address space.

Q1) Does Linux prevent the process's memory from being swapped out when my driver goes into an interruptable sleep?

Q2) Must I use mlock function to prevent the user buffer areas from being paged out?

My device driver will need to copy data from/into the user's memory during interrupt processing.

Q3) Can memcpy_tofs() and memcpy_fromfs() be used within my interrupt processing routine?

Q4) Since Linux does not know the user process associated with the interrupt, how can I ensure the correct user process's memory is accessible for use by the memcpy_*() routines?

Thanks in advance for any feedback !!!!

Dean Kinard kinard@intellistor.com