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) 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.