The HyperNews Linux KHG Discussion Pages

Question: Does memory area assigned by "vmalloc()" get swapped to disk?

Forum: The Linux Kernel Hackers' Guide
Keywords: disk swapping
Date: Sun, 31 May 1998 22:27:59 GMT
From: Saurabh Desai <[email protected]>

Hi Friends !!

I am developing an Informed Prefetching and Caching system as part of the kernel in which it is very important that the memory assigned to hold the data does not get swapped to disk. Without any thought to swapping I used vmalloc() to assign memory to the data structures of the Informed prefetching system. I then realized that the final prefetching system was inefficient in terms of speed when the space assigned to the data structures using vmalloc() was in excess of 10KB. I later realized that most probably the pages assigned using vmalloc() were getting swapped to the disk and when I referenced them, they were brought from the disk rather than memory.

Is there any way to make sure that the assigned pages remain in memory until I release them?

I would appreciate any help in this matter.

Thanx Saurabh Desai


1. Feedback: Lock the pages in memory by [email protected] newer
-> Question: How about assigning a fixed size array...does it get swapped too? by saurabh desai newest