Re: Using IPC-calls in a device driver

Stephen C. Tweedie (sct@redhat.com)
Tue, 1 Jun 1999 23:36:46 +0100 (BST)


Hi,

On Mon, 31 May 1999 19:11:08 +0100 (BST), Alan Cox
<alan@lxorguk.ukuu.org.uk> said:

>> We are a couple of students trying to create a network memory pager on a
>> linux system. The pager is implemented as a device driver, which should be
>> mounted as swapping device. However, we rely heavily on inter process
>> communication. So far we have not been able to figure out how to use these
>> calls in the driver. Or even if it is possible at all.

> If you are swapping I doubt you can. A swap handler cannot do any memory
> allocations or may deadlock. Thats why we dont allow NFS swap for example.

That used to be true. 2.2 should be much better. kswapd now has a
special task property set which prevents any IOs it submits from
requiring recursive memory allocation, and the swapout code in
get_free_pages() does something similar (look for the PF_MEMALLOC
flag). With kpiod, we have also removed an entire class of
filesystem-lock-related deadlock possibilities.

So, any memory allocation invoked by the swapping device will be
serviced by recovering clean pages from memory without any more IO being
submitted. Memory allocations should always be able to make progress
now.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/