The HyperNews Linux KHG Discussion Pages

Question: How about assigning a fixed size array...does it get swapped too?

Forum: The Linux Kernel Hackers' Guide
Re: Question Does memory area assigned by "vmalloc()" get swapped to disk? (Saurabh Desai)
Re: Feedback Lock the pages in memory
Keywords: disk swapping
Date: Thu, 04 Jun 1998 15:27:38 GMT
From: saurabh desai <>

I am sure mlock() works fine..and I will also use sys_mlock() in my kernel code if I have to but the problem with it is that my kernel code becomes part of any user process as it is a Prefetching system and mlock() as seen from its implementation checks for the super user privileges suser(). So probably a user process trying to prefetch is going to be deprived of this request.

I was thinking if the fixed size array (e.g. buffer[100]) gets swapped to disk. I am sure not but just wanted to make sure. For my prefetching system I don't need a whole lot of memory. probably about 2-3K max. Hence I can afford to assign a static array.

thanx pal.