I am working on a Linux driver on x86-64 CentOS 7.
We have a kernel module which reads and writes into files .
This module tries to get pages which are guaranteed to be contiguous.
It works fine when I try smaller read/write
jobs of 5 GB or 10 GB. I get correct kernel virtual address space pointers like 0xffff 8xxx xxxx xxxx
However if I try a bigger job /data (say 20 to 50 GB) then I get these address pointers which look like 0x0000 00xx xxxx xxxxx
. These are not kernel virtual address space pointers.
Due to this I see a OS crash .
However, if I clear cache frequency during the job by using echo 3 > /proc/sys/vm/drop_caches
then it works fine and I get correct kernel virtual address space pointers.
My apologies for this vague type of question. Any hints and suggestion are welcome.
Thanks