Re: is vmalloc ok in kernel?

Benjamin C.R. LaHaise (blah@kvack.org)
Tue, 10 Mar 1998 13:38:41 -0500 (EST)


On Tue, 10 Mar 1998, Kuti Gabor wrote:

> I started working on tmpfs and for this I need virtual mem, that can be
> swapped out. The question is, is vmalloc the function I'm looking for?
> So in case of page fault mm does swap in my page, right?

Alas, no. vmalloc merely allocates a possibly non-contiguous series of
pages and then maps them into the kernel's address space, and is mostly a
workaround for [current] inability of the kernel to allocate large
contiguous regions of memory. Currently there is no mechanism for
swappable kernel data (and it's undesirable for some of the same reasons
that vmalloc is: it requires manipulating the kernel page tables ->
performance hit), and there isn't much of a need for it as the explicite
io mechanisms available are much better than any implicite io page
generates.

You might want to hold off on putting too much effort into writing the
backing store for tmpfs, as I've written code to provide swap-backed
inodes to replace the current ipc/shm.c mess, which should do exactly what
you want. Just wait a couple of days and I'll post the patches...

-ben

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu