The HyperNews Linux KHG Discussion Pages

## 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 <sauru@juno.com>

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

Messages

1. Lock the pages in memory by balaji@ittc.ukans.edu
-> How about assigning a fixed size array...does it get swapped too? by saurabh desai